Preserve admitted command ownership across route path refinements

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 20:37:04 +03:00
parent 286e1fbf33
commit b2faab8ada
4 changed files with 145 additions and 27 deletions
+5 -4
View File
@@ -2,7 +2,8 @@
The caller spins this node and owns observation/command leases. Repeating TF
uses the original measurement stamp. FollowPath updates use Nav2's native
preemption; command admission resumes after feedback for the new goal.
preemption within one caller-bound route context. A new motion task requires
fresh action feedback before command admission resumes.
"""
import math
import threading
@@ -254,8 +255,8 @@ class RosNavigation(Node):
token = object()
received = threading.Event()
with self.condition:
# Updating geometry for the same goal preserves the native
# command stream. A changed goal still needs new feedback.
# Refining the path within the same caller-bound route context
# preserves its native stream. New tasks need fresh feedback.
self.pending_feedback = None if continuing else token
if not continuing:
self.latest_command = None
@@ -280,7 +281,7 @@ class RosNavigation(Node):
raise RuntimeError('Nav2 path update rejected')
self.action_handle, self.terminal = handle, handle.get_result_async()
if continuing:
# This same-goal stream is already admitted during preemption.
# This continuing stream is already admitted during preemption.
# Waiting for its feedback only delays the next sensor frame;
# accept() still fences rejection and late action acceptance.
return self.native_command()