Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
workbenchthis machine
The intent hold falls back to the arm's real settle time (1 s, not 2 s) when the motion gives no duration; arrival stays at 12 ticks or less #535
smith/arm:smith/518-the-intent-hold-falls-back-to-the-arm-s → main 1 commit fork
2 files
changed +4
−4
Software/so101/src/ui/intent.js +1 −1
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | export class Intent { |
| 8 | 8 | /** @param {{ hold?: number, near?: number }} [options] hold: ms an unreached target is kept after release; near: ticks that count as arrived */ |
| 9 | 9 | constructor(options = {}) { |
| 10 | this.hold = options.hold ?? 2000; | |
| 10 | this.hold = options.hold ?? 1000; // the servos settle in 150-330 ms (the steward's table); 1 s is that plus margin | |
| 11 | 11 | this.near = options.near ?? 12; |
| 12 | 12 | /** @type {Map<number, { ticks: number, down: boolean, since: number, hold?: number }>} */ |
| 13 | 13 | this.targets = new Map(); |
Software/so101/src/ui/intent.test.ts +3 −3
| @@ -14,11 +14,11 @@ describe("Intent", () => { | ||
| 14 | 14 | expect(i.target(1, 2995, 600)).toBeNull(); |
| 15 | 15 | expect(i.target(1, 2048, 700)).toBeNull(); |
| 16 | 16 | }); |
| 17 | test("an arm that never arrives is followed again after 2 s", () => { | |
| 17 | test("an arm that never arrives is followed again after 1 s", () => { | |
| 18 | 18 | const i = new Intent(); |
| 19 | 19 | i.set(2, 3000, 0); i.release(2, 0); |
| 20 | expect(i.target(2, 2048, 1999)).toBe(3000); | |
| 21 | expect(i.target(2, 2048, 2000)).toBeNull(); | |
| 20 | expect(i.target(2, 2048, 999)).toBe(3000); | |
| 21 | expect(i.target(2, 2048, 1000)).toBeNull(); | |
| 22 | 22 | }); |
| 23 | 23 | test("a held target is not dropped when the arm happens to be there", () => { |
| 24 | 24 | const i = new Intent(); |
new above
offline