fix(simulation): retire rejected Nav2 intermediate goals

This commit is contained in:
DCCONSTRUCTIONS
2026-10-08 15:29:41 +03:00
parent 1f1d4a2807
commit 021b9f427f
8 changed files with 120 additions and 9 deletions
@@ -114,6 +114,25 @@ class WaypointMission:
self.failed_goals.append(self.goal)
self.goal = None
def reject_local_plan(self, result, pose, seconds, execution_inputs_sha256):
"""Retire an intermediate intent after its bound native planner abort.
This is not an obstacle label or motion permission. The next observed
candidate must obtain its own native path and current command admission.
Preserve task arrival evidence and the existing progress/retry budget.
"""
if (self.fault or self.recovery.active or self.goal is None
or self.last_time != seconds or self.last_pose != tuple(pose)):
return
expected = dict(pose=list(pose), simulation_time_seconds=seconds,
execution_inputs_sha256=execution_inputs_sha256)
if (result.get("route_observation", {}).get("observation") == expected
and result.get("status") == "blocked"
and result.get("speed_mps") == result.get("yaw_rate_rps") == 0.
and result.get("planning_result") == dict(
status="aborted", goal_xy=list(self.goal[:2]))):
self.retire_local_goal(self.arrival_target(), failed=True)
def arrival_candidate(self, pose):
return bool(
self.route