Softer arrival at wave_start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-5
@@ -3,9 +3,9 @@
|
|||||||
The arm goes up along the pose graph (manipulation/arm_route.py: from `look` to `wave_out`, the hand away from the
|
The arm goes up along the pose graph (manipulation/arm_route.py: from `look` to `wave_out`, the hand away from the
|
||||||
head, then `wave_start`, the hand above the head), swings between the taught poses `wave_start` and `wave` (J3 −14.7°)
|
head, then `wave_start`, the hand above the head), swings between the taught poses `wave_start` and `wave` (J3 −14.7°)
|
||||||
SWINGS times and STAYS at `wave_start`: the next arm task takes it back down the same way (wave_start -> wave_out
|
SWINGS times and STAYS at `wave_start`: the next arm task takes it back down the same way (wave_start -> wave_out
|
||||||
-> look). The way up goes like arm_route.goto, each move to a stop; the swings run back to back. Before
|
-> look). The way up goes like arm_route.goto, each move to a stop, the last one (into wave_start) at ARRIVE_SPEED;
|
||||||
anything moves, every joint move is checked (arm_route.check_moves: limits, travel, the gripper clear of the head, no
|
the swings run back to back. Before anything moves, every joint move is checked (arm_route.check_moves: limits,
|
||||||
dip). Refused, with the reason in English and Korean: the arm off or busy, the base driving, a task
|
travel, the gripper clear of the head, no dip). Refused, with the reason in English and Korean: the arm off or busy, the base driving, a task
|
||||||
running, something in the hand, the arm at no known pose (after free drive), a pose not taught, a move too near the
|
running, something in the hand, the arm at no known pose (after free drive), a pose not taught, a move too near the
|
||||||
head.
|
head.
|
||||||
|
|
||||||
@@ -23,7 +23,8 @@ from robot import agv, arm, gripper, motion
|
|||||||
START = "wave_start" # hand above the head; the wave starts and ends here
|
START = "wave_start" # hand above the head; the wave starts and ends here
|
||||||
SWING = "wave" # START with J3 −14.7°
|
SWING = "wave" # START with J3 −14.7°
|
||||||
SWINGS = 2 # times START -> SWING -> START
|
SWINGS = 2 # times START -> SWING -> START
|
||||||
SWING_SPEED = "normal" # motion.JOINT_SPEED of the swings; the way up is arm_route.move (as goto)
|
SWING_SPEED = "normal" # motion.JOINT_SPEED of the swings; the way up is arm_route.SPEED ...
|
||||||
|
ARRIVE_SPEED = "normal" # ... but its last move, into START: at route speed it stopped there hard (J1 60°)
|
||||||
|
|
||||||
# Why Lumi does not wave, (English, Korean)
|
# Why Lumi does not wave, (English, Korean)
|
||||||
OFF = ("Please enable my arm first.", "먼저 제 팔을 켜 주세요.")
|
OFF = ("Please enable my arm first.", "먼저 제 팔을 켜 주세요.")
|
||||||
@@ -96,7 +97,11 @@ def wave(on_start=None):
|
|||||||
log(f"wave: {len(route) + len(swings)} joint moves, checked")
|
log(f"wave: {len(route) + len(swings)} joint moves, checked")
|
||||||
if on_start:
|
if on_start:
|
||||||
on_start()
|
on_start()
|
||||||
arm_route.move(route) # up exactly as arm_route.goto
|
if route: # up as arm_route.goto, a stop at each pose; softer into START
|
||||||
|
t0 = time.time()
|
||||||
|
log(f"arm to {' -> '.join(n for n, _ in route)}")
|
||||||
|
motion.move_path([(j, arm_route.SPEED) for _, j in route[:-1]] + [(route[-1][1], ARRIVE_SPEED)])
|
||||||
|
log(f"arm at {START} after {time.time() - t0:.1f} s")
|
||||||
if route and motion._stopped.wait(motion.SETTLE_S): # stand at START first, as between any two moves
|
if route and motion._stopped.wait(motion.SETTLE_S): # stand at START first, as between any two moves
|
||||||
raise motion.MotionError("stopped")
|
raise motion.MotionError("stopped")
|
||||||
t0 = time.time()
|
t0 = time.time()
|
||||||
|
|||||||
+4
-1
@@ -96,7 +96,10 @@ a.j = list(LOOK)
|
|||||||
wave.wave()
|
wave.wave()
|
||||||
sent = [e for e in names if e[0] in ("joint_move", "get_data")]
|
sent = [e for e in names if e[0] in ("joint_move", "get_data")]
|
||||||
route, swing_s = motion.JOINT_SPEED[arm_route.SPEED], motion.JOINT_SPEED[wave.SWING_SPEED]
|
route, swing_s = motion.JOINT_SPEED[arm_route.SPEED], motion.JOINT_SPEED[wave.SWING_SPEED]
|
||||||
assert sent == [("joint_move", route, False), ("get_data", None, False)] * 2 + \
|
arrive = motion.JOINT_SPEED[wave.ARRIVE_SPEED] # into wave_start softer than the route speed
|
||||||
|
assert arrive < route and wave.ARRIVE_SPEED == "normal"
|
||||||
|
assert sent == [("joint_move", route, False), ("get_data", None, False), ("joint_move", arrive, False),
|
||||||
|
("get_data", None, False)] + \
|
||||||
[("joint_move", swing_s, False)] * 2 * wave.SWINGS + [("get_data", None, False)], sent # swings back to back
|
[("joint_move", swing_s, False)] * 2 * wave.SWINGS + [("get_data", None, False)], sent # swings back to back
|
||||||
assert wave.SWING_SPEED == "normal"
|
assert wave.SWING_SPEED == "normal"
|
||||||
arm.cmd = a
|
arm.cmd = a
|
||||||
|
|||||||
Reference in New Issue
Block a user