Keep local navigation on its path across goal refinements

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 20:02:11 +03:00
parent 4e84aad33f
commit 286e1fbf33
2 changed files with 71 additions and 4 deletions
+15 -4
View File
@@ -143,9 +143,12 @@ class Navigation:
detected=observed['detected']):
return self.reply('stale-range')
route = route_observation(terrain, pose, value, self.monitor.max_step)
# Return the same observed search obstacles used by Smac, as bounded
# intent guidance only. Goal selection must see unlabelled solids too.
hazards = observed['search_terrain']
# Centre between observed solids, including unlabelled ones. Search
# hints for rejected contact patches are not objects: assigning their
# nearest return an obstacle radius moves the local endpoint across a
# clear passage as patch queries change. Smac still receives the full
# search layer; semantic/contact gates still admit every actual sweep.
hazards = observed['collision_terrain']
hazards = hazards[hazards[:, 3] > self.monitor.max_step + 1e-4, :2]
if len(hazards):
_, indices = np.unique(np.floor(hazards / .05), axis=0, return_index=True)
@@ -188,8 +191,16 @@ class Navigation:
aligning = (not reverse and value['translation_allowed']
and self.action_key == alignment_key and self.node.terminal is not None
and not self.node.terminal.done())
# A changing local endpoint is still a FollowPath task. Let Smac/DWB
# choose its curve; facing the endpoint directly is not a prerequisite
# for following that curve. Preempting a live path with Spin on every
# >30 degree bearing change creates stop/turn/advance oscillations.
# A completed/aborted path and explicit mission recovery may still
# select a fully observed in-place turn before starting translation.
following = (self.action_key is not None and self.action_key[0] == 'path'
and self.node.terminal is not None and not self.node.terminal.done())
turn = None
if (not reverse and value['translation_allowed'] and not aligning
if (not reverse and value['translation_allowed'] and not aligning and not following
and alignment_key != self.attempted_alignment):
turn = alignment_angle(pose, goal, terrain, observed['detected'], self.monitor,
value['body_contact_height_m'],