Skip to content

Adds support for replanning when a progress error is raised - #39

Open
arjo129 wants to merge 2 commits into
mainfrom
arjo/feat/replan_trigger
Open

Adds support for replanning when a progress error is raised#39
arjo129 wants to merge 2 commits into
mainfrom
arjo/feat/replan_trigger

Conversation

@arjo129

@arjo129 arjo129 commented Jul 13, 2026

Copy link
Copy Markdown
Member

New feature implementation

Implemented feature

This PR adds support for replanning when a progress error is raised. We also add similar nav2 support for handling such progress errors.

Implementation description

Rather than repeatedly retrying a location, this PR adds support for replanning when an error message is caught.

GenAI Use

We follow OSRA's policy on GenAI tools

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Generated-by:

This PR adds support for replanning when a progress error is raised. We
also add similar nav2 support for handling such progress errors.

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
@mxgrey mxgrey added this to PMC Board Jul 13, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in PMC Board Jul 13, 2026
@mxgrey mxgrey moved this from Inbox to In Progress in PMC Board Jul 14, 2026
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
@arjo129
arjo129 marked this pull request as ready for review July 22, 2026 07:42
@arjo129

arjo129 commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

cc: @SamuelFoo
Take a look at this PR once and give it a review

@arjo129
arjo129 changed the base branch from epic/next-gen-base to main July 24, 2026 02:56
@SamuelFoo

SamuelFoo commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

One integration issue exposed by this replanning flow is that update_incremental_target suppresses nearby targets based only on distance. A replan can begin with the same incremental target but a new PlanId; suppressing that update leaves Nav2 operating under the old plan identity and may cause it to stall. Our obstacle-replan integration resends unchanged targets whenever the plan changes and adds coverage for this case: SamuelFoo@12a7ae9

However, this is outside the changes in this PR.

Comment on lines -739 to 749
if let Ok(inner_nav_client) = inner_nav_clients.get(target.agent) {
if let Some(active_goal) = inner_nav_client.goal() {
if active_goal.id() != &target.safe_zone_id {
debug!(
"[{:?}] Aborted goal is stale, not retrying",
if let Ok(publisher) = plan_error_publishers.get(target.agent) {
let plan_error = ros_env::rmf_prototype_msgs::msg::PlanError {
error: ros_env::rmf_prototype_msgs::msg::Error {
code: ros_env::rmf_prototype_msgs::msg::PlanError::CODE_PATH_BLOCKED,
message: format!(
"Nav2 goal aborted for agent {:?}: path blocked within safe zone",
target.agent.index()
);
return Err(result);
}
),
parameters: String::new(),
},
plan_id: handle.request.safe_zone_id.plan_id.clone(),
};
if let Err(e) = publisher.publisher.publish(plan_error) {
error!(
"Failed to publish PlanError for agent {:?}: {:?}",
target.agent.index(),
e
);
} else {
warn!(
"[{:?}] Goal aborted by Nav2! Published PlanError CODE_PATH_BLOCKED to ~/plan/error.",
target.agent.index()
);
}
}

@SamuelFoo SamuelFoo Jul 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should retain the active-goal check before publishing CODE_PATH_BLOCKED? When a replan produces a newer SafeZone, the Nav2 bridge cancels the current goal and submits the new incremental target. The superseded goal may still report Aborted; treating that result as current triggers another replan and causes oscillation.

I made an integration that addresses this by marking replaced goals as superseded and checking the full SafeZoneId: SamuelFoo@f0da686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Feature request]: Handle failure to plan given unforseen constraints at a local planning level

3 participants