Keep through-travel heading at lateral local goals

This commit is contained in:
DCCONSTRUCTIONS
2026-10-10 02:48:25 +03:00
parent e3d116d5b0
commit f12f5e86c9
2 changed files with 60 additions and 1 deletions
+12 -1
View File
@@ -281,7 +281,18 @@ class Navigation:
if (key != self.action_key or not continuing or self.path is None
or self.node.native_command() is None
or entered-self.path_planned_at >= 1.0):
path, status = self.node.plan(pose, goal, math.atan2(goal[1]-pose[1],goal[0]-pose[0]))
heading = math.atan2(goal[1]-pose[1], goal[0]-pose[0])
if (value.get('continuous', False) and target is None
and not value.get('recovery_orientation', False)
and orientation is not None and 'direction_xy' in orientation):
# The observed passage selects XY; the declared continuation
# supplies its through-travel heading. Re-aiming the terminal
# body toward a nearby lateral XY each replan makes the
# approach progressively tighter instead of rejoining travel.
# Smac still checks the complete path and footprint, and the
# live support/collision gates retain all motion authority.
heading = math.atan2(*reversed(orientation['direction_xy']))
path, status = self.node.plan(pose, goal, heading)
if path is None or len(path.poses) < 2:
self.stop()
# Humble has no typed planner error code. Preserve its