Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
workbenchthis machine
A zone block's depthMm matches the geometry: the impossible 'moving_jaw depthMm 177' is reproduced and fixed #455
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
smith/arm:smith/449-a-zone-block-s-depthmm-matches-the-geome → main 1 commit fork
1 file
changed +17
−0
Software/so101/src/kinematics.test.ts +17
| @@ -77,6 +77,23 @@ describe("the SO-101 model", () => { | ||
| 77 | 77 | expect(v!.depth).toBeCloseTo(0.015, 6); // 10 mm under the moved table, plus the margin |
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | test("a moving_jaw block of about 177 mm is a real pose, not a measurement error (#449)", () => { | |
| 81 | // The live log's `block … moving_jaw … depthMm: 177` judges the pose a command would make, not the arm at rest. | |
| 82 | // Defaults: floor margin 15 mm, no table offset. Lift forward 70°, elbow straight, wrist 26°, jaw 12° puts the jaw far under the table. | |
| 83 | const settings = { floorMargin: 0.015, baseMargin: 0.01, tableOffset: 0 }; | |
| 84 | const rest = deg([0, 0, 0, 0, 0, 0]); | |
| 85 | expect(model.check(rest, settings)).toBeNull(); // the arm resting is not blocked at all | |
| 86 | const q = deg([0, 70, 0, 26, 0, 12]); | |
| 87 | const v = model.check(q, settings)!; | |
| 88 | expect(v.what).toBe("table"); | |
| 89 | expect(v.link).toBe("moving_jaw_so101_v1_link"); | |
| 90 | // The depth is the margin plus the distance under the model's floor, measured on the jaw's own world position. | |
| 91 | expect(v.depth).toBeCloseTo(settings.floorMargin + model.floorZ - v.point[2], 9); | |
| 92 | expect(Math.round(v.depth * 1000)).toBe(178); // the logged 177 is this pose within a degree or two | |
| 93 | // The table offset moves the depth one for one, in the right direction: a table 50 mm lower makes it 50 mm shallower. | |
| 94 | expect(model.check(q, { ...settings, tableOffset: -0.05 })!.depth).toBeCloseTo(v.depth - 0.05, 9); | |
| 95 | }); | |
| 96 | ||
| 80 | 97 | test("ticks map to radians around the middle of the calibrated range, and back", () => { |
| 81 | 98 | expect(ticksToRadians(2048, 1000, 3096)).toBe(0); |
| 82 | 99 | expect(ticksToRadians(2048 + 4095 / 4, 1000, 3096)).toBeCloseTo(Math.PI / 2, 9); |
new above
offline