Bound corridor ranking work and retire aborted local actions

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 14:36:52 +03:00
parent 25e8fb7e43
commit c43b097a3a
4 changed files with 138 additions and 13 deletions
+40
View File
@@ -347,3 +347,43 @@ def test_native_backoff_does_not_clear_current_recovery_round_or_motion_failures
mission.retry_native_goals(3.)
assert mission.failed_goals == [other]
assert mission.attempts == 0 and mission.anchor_time == 0
def aborted_follow(goal, p, seconds):
result = aborted_plan(goal, p, seconds)
result['action_result'] = {**result.pop('planning_result'), 'kind': 'path'}
return result
def test_followpath_abort_does_not_wait_for_stall_or_force_recovery():
mission = WaypointMission([[8, 0]])
first, _ = mission.update(pose(), 0, goal)
mission.reject_local_plan(aborted_follow(first, pose(), 0), pose(), 0, 'run')
assert mission.goal is None and mission.failed_goals == [first]
second, intent = mission.update(pose(), .1, goal)
assert second != first and not mission.recovery.active
assert mission.anchor_time == 0 and mission.attempts == 0
# Native aborts and replacement goals still earn no task progress.
for t in range(1, 34):
current, _ = mission.update(pose(), t, goal)
if current is not None:
mission.reject_local_plan(aborted_follow(current, pose(), t), pose(), t, 'run')
assert mission.fault == 'stuck'
@pytest.mark.parametrize('mismatch', ['kind', 'goal', 'status', 'run', 'pose', 'time', 'moving'])
def test_followpath_abort_must_belong_to_current_goal_and_observation(mismatch):
mission = WaypointMission([[8, 0]])
first, _ = mission.update(pose(), 1, goal)
result = aborted_follow(first, pose(), 1)
receipt = result['action_result']
observation = result['route_observation']['observation']
if mismatch == 'kind': receipt['kind'] = 'backup'
elif mismatch == 'goal': receipt['goal_xy'] = [100., 100.]
elif mismatch == 'status': receipt['status'] = 'canceled'
elif mismatch == 'run': observation['execution_inputs_sha256'] = 'other'
elif mismatch == 'pose': observation['pose'] = pose(.1)
elif mismatch == 'time': observation['simulation_time_seconds'] = .9
elif mismatch == 'moving': result['speed_mps'] = .1
mission.reject_local_plan(result, pose(), 1, 'run')
assert mission.goal == first and mission.failed_goals == []