Keep advisory route joints directional and preserve observed clearance
This commit is contained in:
@@ -192,11 +192,16 @@ class RoutedMission(WaypointMission):
|
||||
along, lateral = projection(pose[:2], segment["start_xy"], segment["end_xy"])
|
||||
self.remaining = max(0.0, self.leg["length_m"] - self.completed_length - along) + lateral * (
|
||||
.15 if segment.get("guidance_only") else 1.)
|
||||
# Supply a stable segment endpoint. The visual/local planner already
|
||||
# chooses observed intermediate goals within its own lookahead. A second
|
||||
# 0.8m target here sits in the camera blind strip and can make it choose
|
||||
# unrelated farther pixels instead of remembering a visible corner.
|
||||
self.route_target = list(segment["end_xy"])
|
||||
if self.advisory_joint():
|
||||
# A map joint describes continuation, not a chassis destination.
|
||||
# Preserve its direction when the measured passage runs beside it:
|
||||
# a lateral offset must not turn into a 90-degree attraction as the
|
||||
# rover draws level. Arrival/adjacent-support queries still use the
|
||||
# actual joint and alone advance the route cursor.
|
||||
direction = np.asarray(segment["end_xy"]) - segment["start_xy"]
|
||||
direction /= np.linalg.norm(direction)
|
||||
self.route_target = (np.asarray(pose[:2]) + 6.*direction).tolist()
|
||||
|
||||
def distance_to_target(self, pose, target):
|
||||
return self.remaining
|
||||
@@ -360,7 +365,7 @@ class RoutedMission(WaypointMission):
|
||||
# native planner abort must retire a measured goal near that hint;
|
||||
# preserving it as task-arrival evidence pins the rover to a blocked
|
||||
# intermediate point. Explicit goals and return anchors retain it.
|
||||
super().retire_local_goal(None if advisory_joint else self.route_target, failed=failed)
|
||||
super().retire_local_goal(None if advisory_joint else self.arrival_target(), failed=failed)
|
||||
|
||||
def arrival_candidate(self, pose):
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user