Keep live guarded path when a same-leg extension is rejected
This commit is contained in:
@@ -283,17 +283,33 @@ class Navigation:
|
||||
or entered-self.path_planned_at >= 1.0):
|
||||
path, status = self.node.plan(pose, goal, math.atan2(goal[1]-pose[1],goal[0]-pose[0]))
|
||||
if path is None or len(path.poses) < 2:
|
||||
self.stop()
|
||||
# Humble has no typed planner error code. Preserve its
|
||||
# terminal abort without inventing an obstacle diagnosis.
|
||||
feedback = (dict(planning_result=dict(status='aborted', goal_xy=goal[:2].tolist()))
|
||||
if status == GoalStatus.STATUS_ABORTED else {})
|
||||
return self.reply('no-path', status='blocked', route_observation=route, **feedback)
|
||||
if not continuing:
|
||||
self.revoke_command()
|
||||
self.node.follow(path, continuing=continuing)
|
||||
self.path, self.path_planned_at = path, entered
|
||||
self.path_context = context
|
||||
native = self.node.native_command()
|
||||
# A rejected extension does not invalidate the executing
|
||||
# path. Never restart it or recycle its old velocity: keep
|
||||
# only a live same-leg action, admitted below against this
|
||||
# observation and against current range on every tick.
|
||||
if (status == GoalStatus.STATUS_ABORTED and following and continuing
|
||||
and context is not None and value.get('arrival_target') is None
|
||||
and key != self.action_key and self.path is not None
|
||||
and len(self.path.poses) >= 2 and self.node.terminal is not None
|
||||
and not self.node.terminal.done() and native is not None
|
||||
and time.monotonic()-native[0] <= .25):
|
||||
receipts['refinement_result'] = dict(status='aborted',
|
||||
goal_xy=goal[:2].tolist(), executing_goal_xy=list(self.action_key[1]))
|
||||
key = self.action_key
|
||||
else:
|
||||
self.stop()
|
||||
# Humble has no typed planner error code. Preserve its
|
||||
# terminal abort without inventing an obstacle diagnosis.
|
||||
feedback = (dict(planning_result=dict(status='aborted', goal_xy=goal[:2].tolist()))
|
||||
if status == GoalStatus.STATUS_ABORTED else {})
|
||||
return self.reply('no-path', status='blocked', route_observation=route, **feedback)
|
||||
else:
|
||||
if not continuing:
|
||||
self.revoke_command()
|
||||
self.node.follow(path, continuing=continuing)
|
||||
self.path, self.path_planned_at = path, entered
|
||||
self.path_context = context
|
||||
path = self.path
|
||||
c, s = math.cos(yaw_of(pose)), math.sin(yaw_of(pose))
|
||||
local_path = [[(p.pose.position.x-pose[0])*c+(p.pose.position.y-pose[1])*s,
|
||||
|
||||
Reference in New Issue
Block a user