diff --git a/robot/nav_guard.py b/robot/nav_guard.py index a645923..bdf20c2 100644 --- a/robot/nav_guard.py +++ b/robot/nav_guard.py @@ -16,6 +16,8 @@ import time from robot import agv +ENABLED = False # off (owner, 2026-10-22): it stopped drives near the docks and in narrow places; navigation + # drives as before. Turns on the spot and joy_control moves keep their own arm checks (tasks/fetch.py) MARGIN_M = 0.10 # m; an arm point nearer than this to an obstacle stops the drive (estimate, tune live) LOOKAHEAD_M = 0.30 # m along the planned path checked ahead of the base: ~1 s at 0.3 m/s, its stop included (estimate) STEP_M = 0.15 # m between the path points checked @@ -88,6 +90,8 @@ def hit(pose, poses, pts): def watch(command, gen): """Guard the navigation move `command` (sent just now) until it ends or agv's guard generation moves on.""" + if not ENABLED: + return threading.Thread(target=_run, args=(command, gen), daemon=True, name="nav-guard").start() diff --git a/tests/test_nav_guard.py b/tests/test_nav_guard.py index ea4a874..f0877f6 100644 --- a/tests/test_nav_guard.py +++ b/tests/test_nav_guard.py @@ -11,6 +11,7 @@ from tasks import fetch nav_guard.POLL_S = 0.01 nav_guard.CLEAR_S = 0.1 nav_guard.START_S = 0.3 +nav_guard.ENABLED = True # the guard itself is checked here (off on the robot) nav_guard.PATH_EVERY_S = 0.05 nav_guard.BLOCK_S = 1.0 nav_guard.log = lambda msg: logs.append(msg)