Skip to content

Improve BT navigation failure robustness and diagnostics#6245

Draft
Rpirayesh wants to merge 1 commit into
ros-navigation:mainfrom
Rpirayesh:bt-navigation-failure-robustness
Draft

Improve BT navigation failure robustness and diagnostics#6245
Rpirayesh wants to merge 1 commit into
ros-navigation:mainfrom
Rpirayesh:bt-navigation-failure-robustness

Conversation

@Rpirayesh

Copy link
Copy Markdown

Summary

  • reject invalid NavigateThroughPoses replacement goals without aborting the active goal
  • flush terminal Behavior Tree status transitions after tree execution completes
  • fail fast on missing navigation BT action inputs and populate error outputs
  • add recovery retry diagnostics and targeted regression coverage

Validation

  • Added BT action unit coverage for missing navigation inputs, FollowPath failure propagation, and active goal replacement.
  • Added NavigateThroughPoses system coverage for bad-TF replacement preemption.

Audit and harden failure propagation in Behavior Tree navigation:
reject bad-TF preemption goals instead of aborting active navigation,
flush terminal BT status transitions, populate error codes/messages
on BT action node failures, add explicit and rate-limited logging for
recovery retries and preempt-without-pending-goal cases, and extend
BT/system tests to cover these paths. No external ROS interfaces
(actions, services, topics, params) or BT plugin base-class APIs are
changed.
@SteveMacenski

SteveMacenski commented Jul 7, 2026

Copy link
Copy Markdown
Member

Please fill in the PR template properly and sign off on DCO. I also see that your PR doesn't build, which looks like your fork is very out of date and needs to be rebased or pulling in main to turn over. I can review once we have a full PR description, DCO, and at least ~nominally passing build.

I will give this a short initial glance though

@SteveMacenski SteveMacenski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't really have an issue with much of anything in this PR, but I need a description of need for many of these items - or if they're all AI generated theoretical issues

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove the AI generated file.

Comment on lines -139 to +142
RCLCPP_ERROR(logger_, "Robot pose is not available.");
RCLCPP_WARN_THROTTLE(
logger_, *clock_, 2000,
"Robot pose is not available for NavigateToPose feedback. "
"This is often caused by delayed TF or intermittent localization.");

@SteveMacenski SteveMacenski Jul 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should remain an Error. Additionally, you should remove the "This is often caused.." as this is a sophisticated issue that I would not want to lead users down unfruitful paths. I understand the reason to throttle though, but it should definitely not be throttled any lower than 1hz

Comment on lines -160 to +163
RCLCPP_ERROR(logger_, "Robot pose is not available.");
RCLCPP_WARN_THROTTLE(
logger_, *clock_, 2000,
"Robot pose is not available for NavigateThroughPoses feedback. "
"This is often caused by delayed TF or intermittent localization.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ditto

Comment on lines +410 to +415
if (!pending_goal) {
RCLCPP_WARN_THROTTLE(
logger_, *clock_, 2000,
"Preempt requested for %s, but no pending goal is available. Ignoring preempt.",
action_name_.c_str());
} else {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this a real case you ran into?

Comment on lines +93 to +104
if (result == BT::NodeStatus::FAILURE) {
RCLCPP_WARN(
rclcpp::get_logger("BehaviorTreeEngine"),
"Behavior Tree completed with FAILURE status at root node '%s'.",
tree->rootNode() ? tree->rootNode()->name().c_str() : "<unknown>");
} else if (result == BT::NodeStatus::IDLE) {
RCLCPP_ERROR(
rclcpp::get_logger("BehaviorTreeEngine"),
"Behavior Tree returned unexpected IDLE status at root node '%s'. Treating as failure.",
tree->rootNode() ? tree->rootNode()->name().c_str() : "<unknown>");
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In such cases, were there not logging / warnings anywhere otherwise listed that make this duplicate?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Discussion point: in this file, I'm cautious to make exceeding retries as an "error" case. This could be used in cases where the recovery case is not really an 'error' and logging like this would imply its use. I agree with adding some debug logging though if you think its helpful. Maybe the error cases should either be infos or also debugs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants