Queued arm moves wait while the arm moves; wave rise at route speed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 17:58:58 +09:00
co-authored by Claude Opus 5.5
parent 217eb93d81
commit a5ae852097
4 changed files with 102 additions and 30 deletions
+9 -3
View File
@@ -47,6 +47,8 @@ class FakeArm:
return {"cartPosition": [10 * j[0], 10 * j[1], 10 * j[2], 0.0, 0.0, 0.0], "errorCode": "0"}
if name == "get_data":
return {"joint_actual_position": list(self.j), "inpos": True}
if name == "get_motion_state":
return {"queue": 0, "active_queue": 0, "errorCode": "0"}
if name == "joint_move":
self.sent.append(list(a["jointPosition"]))
self.j = list(a["jointPosition"])
@@ -87,11 +89,15 @@ a.sent.clear()
a.j = list(swing) # stopped at wave: back to wave_start, then swings
wave.wave()
assert a.sent == [top] + [swing, top] * wave.SWINGS, a.sent
names = [] # all moves sent one after another, no poll
arm.cmd = lambda name, **k: (names.append(name), a(name, **k))[1] # between them
names = [] # the way up as arm_route.goto sends it, then the
arm.cmd = lambda name, **k: (names.append((name, k.get("speed"), k.get("tol"))), a(name, **k))[1] # swings, each queued
a.j = list(LOOK)
wave.wave()
assert [n for n in names if n in ("joint_move", "get_data")][:3 + 2 * wave.SWINGS] == ["joint_move"] * (2 + 2 * wave.SWINGS) + ["get_data"], names
sent = [(n, v, t) for n, v, t in names if n in ("joint_move", "get_data")]
route, swing_s = motion.JOINT_SPEED[arm_route.SPEED], motion.JOINT_SPEED[wave.SWING_SPEED]
assert sent[:3] == [("joint_move", route, arm_route.TOL), ("joint_move", route, None), ("get_data", None, None)], sent
assert sent[3:4 + 2 * wave.SWINGS] == [("joint_move", swing_s, None)] * 2 * wave.SWINGS + [("get_data", None, None)], sent
assert wave.SWING_SPEED == "normal"
arm.cmd = a
a.j = list(top)
a.sent.clear()