Separate Nav2 body collision from ground search costs

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 12:22:26 +03:00
parent 39dd3bb551
commit 51406fc90c
6 changed files with 192 additions and 7 deletions
+8 -4
View File
@@ -91,12 +91,15 @@ class Navigation:
terminal = self.node.terminal
if (key == self.action_key and key[0] in {'path', 'backup'}
and terminal is not None and terminal.done()
and terminal.result().status == GoalStatus.STATUS_SUCCEEDED):
and terminal.result().status in (GoalStatus.STATUS_SUCCEEDED, GoalStatus.STATUS_ABORTED)):
# Preserve the native terminal result before a sensor refresh can
# submit the same FollowPath again. This is local-action completion,
# not whole-body arrival admission and never a motion proposal.
return self.reply('native-action-complete', route_observation=route,
action_result=dict(status='succeeded', kind=key[0], goal_xy=list(key[1])))
succeeded = terminal.result().status == GoalStatus.STATUS_SUCCEEDED
return self.reply('native-action-complete' if succeeded else 'native-action-aborted',
status='waiting-for-plan' if succeeded else 'blocked', route_observation=route,
action_result=dict(status='succeeded' if succeeded else 'aborted',
kind=key[0], goal_xy=list(key[1])))
return None
def plan(self, value):
@@ -135,7 +138,8 @@ class Navigation:
terrain = observed['terrain']
self.latest_terrain = observed
observed['observation_id'] = value['observation_id']
if not self.collision.publish(value, observed['search_terrain'], time.monotonic()-entered,
if not self.collision.publish(value, observed['collision_terrain'], time.monotonic()-entered,
search_terrain=observed['search_terrain'],
detected=observed['detected']):
return self.reply('stale-range')
route = route_observation(terrain, pose, value, self.monitor.max_step)