Arm routes queued without stops at via-points; wave with two swings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+11
-5
@@ -68,25 +68,31 @@ def refused(reason):
|
||||
raise AssertionError(f"waved, expected {reason}")
|
||||
|
||||
|
||||
# ---------- from look: up through wave_out, 3 swings, the arm stays at wave_start; every move clear of the head ------
|
||||
# ---------- from look: up through wave_out, 2 swings, the arm stays at wave_start; every move clear of the head ------
|
||||
a = use(FakeArm(LOOK))
|
||||
started = []
|
||||
wave.wave(on_start=lambda: started.append(len(a.sent)))
|
||||
assert started == [0] # said before the first move
|
||||
top, swing = POSES["wave_start"], POSES["wave"]
|
||||
assert wave.SWINGS == 3
|
||||
assert a.sent == [POSES["wave_out"], top] + [swing, top] * 3, a.sent
|
||||
assert wave.SWINGS == 2
|
||||
assert a.sent == [POSES["wave_out"], top] + [swing, top] * wave.SWINGS, a.sent
|
||||
for j0, j1 in zip([LOOK] + a.sent, a.sent):
|
||||
assert arm_route.profile(j0, j1, HEAD)[0] >= arm_route.HEAD_CLEAR_MM, (j0, j1)
|
||||
assert arm_route.profile(LOOK, top, HEAD)[0] < arm_route.HEAD_CLEAR_MM # straight up from look would pass the head
|
||||
assert {"look", "wave_start"} not in [set(e) for e in arm_route.EDGES] # so there is no such edge
|
||||
a.sent.clear()
|
||||
wave.wave() # asked again while up: only the swings
|
||||
assert a.sent == [swing, top] * 3, a.sent
|
||||
assert a.sent == [swing, top] * wave.SWINGS, a.sent
|
||||
a.sent.clear()
|
||||
a.j = list(swing) # stopped at wave: back to wave_start, then swings
|
||||
wave.wave()
|
||||
assert a.sent == [top] + [swing, top] * 3, a.sent
|
||||
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
|
||||
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
|
||||
arm.cmd = a
|
||||
a.j = list(top)
|
||||
a.sent.clear()
|
||||
assert arm_route.goto("look") == ["wave_out", "look"] # the way down
|
||||
|
||||
Reference in New Issue
Block a user