From 27182df9654462853f86577141be5ec943924f82 Mon Sep 17 00:00:00 2001 From: Cutshion Date: Mon, 26 Oct 2026 18:54:30 +0900 Subject: [PATCH] Hold the lift at the bottom until the longer head camera cable is in Co-Authored-By: Claude Opus 5.5 --- robot/head.py | 6 +++--- tasks/fetch.py | 6 +++--- tests/test_fetch.py | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/robot/head.py b/robot/head.py index a91c7ec..dccbe86 100644 --- a/robot/head.py +++ b/robot/head.py @@ -17,9 +17,9 @@ HEAD_REST_PITCH = PITCH_RANGE[0] # deg; the head's rest: its lowest, looking do # and near things are in view. Every "head back / ahead" uses it; yaw rests at 0 VEL = 40 # speed ratio %, 1-100 (was 15: too slow to follow a visitor) ACC = 40 # acceleration ratio %, 1-100 -# Temporary (2026-10-20): the head camera's cable is too short, a higher lift pulls it out. Back to 250 mm (what -# tasks/fetch.py used before; the body API allows 300) when the longer cable is in. -LIFT_MAX_MM = 105.0 +# Temporary: the head camera's cable is too short, any lift above the bottom pulls it out, so the lift stays at 0 and +# Lumi searches by driving and turning. Back to 250 mm (the body API allows 300) when the longer cable is in. +LIFT_MAX_MM = 0.0 # [lift mm, waist, head yaw, head pitch] limits of the body API (docs/03), the lift held to LIFT_MAX_MM. The controller # drops a whole moveto when any value is outside, and its own encoders read a little past the ends (pitch -5.003 at # the bottom stop). diff --git a/tasks/fetch.py b/tasks/fetch.py index d158989..1091c2b 100644 --- a/tasks/fetch.py +++ b/tasks/fetch.py @@ -79,8 +79,8 @@ SURFACE_Z = (-560.0, -30.0) # mm, arm frame, after the lift: table tops the arm # the grasp, 2026-10-16: -578 4 of 9 spots, -528 7 of 9, -28 9 of 9). Lower: a floor or a # seat ~30 cm under a table, which no grasp reaches even at lift 0 LIFT_TOL_MM = 20.0 # closer than this: the lift stays -LIFT_RANGE = (0.0, head.LIFT_MAX_MM) # mm; 0-105 for now (head camera cable, robot/head.py), 0-250 with the long one -LIFT_DRIVE_MM = 75.0 # every drive, every task's end and a look that found nothing again at this lift +LIFT_RANGE = (0.0, head.LIFT_MAX_MM) # mm; 0 only for now (head camera cable, robot/head.py), 0-250 with the long one +LIFT_DRIVE_MM = min(75.0, head.LIFT_MAX_MM) # every drive, every task's end and a look that found nothing again at this lift # (higher, the near part of the table is below the torso camera's view) LIFT_VEL = 20 # % of the lift's speed VIEW_STEPS = (60.0, 120.0, 180.0) # search (_look_around): both cameras look this far (deg from the front) to one @@ -770,7 +770,7 @@ def _look_around(attempt, holding=False, say=None): sides = [s * v for s in (side, -side) for v in VIEW_STEPS] if arm_yaw() is not None or _head_ok() else [] here = head.status()[0] other = LIFT_TRIES[1] if here < sum(LIFT_TRIES) / 2 else LIFT_TRIES[0] - for n, lift in enumerate((None, other)): + for n, lift in enumerate((None, other) if abs(other - here) >= 1.0 else (None,)): # no other lift: one pass if lift is not None: _lift_to(lift) for turned in (False, True): diff --git a/tests/test_fetch.py b/tests/test_fetch.py index e6a36e4..4a727d1 100644 --- a/tests/test_fetch.py +++ b/tests/test_fetch.py @@ -8,6 +8,9 @@ from pathlib import Path import numpy as np +from robot import head +assert head.LIFT_MAX_MM == 0.0 # live: the lift stays at the bottom (head camera cable); the cases below are the long cable's +head.LIFT_MAX_MM, head.AXIS_LIMITS = 105.0, ((0.0, 105.0),) + head.AXIS_LIMITS[1:] from manipulation import skills from tasks import fetch from vision import calib