Skip to content

Conversation

@Pana1v
Copy link

@Pana1v Pana1v commented Oct 8, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses (replace with ticket(s), e.g. #1234)
Primary OS tested on Ubuntu 22.04
Robotic platform tested on Gazebo simulation (navigation2 demo)
Does this PR contain AI generated software? No
Was this PR description generated by AI software? No

Description of contribution in a few bullet points

  • Added error_code and error_msg handling to NavigateToPose action result/feedback handling.
  • When a result contains an error, call bt_action_server_->populateInternalError(result) and log internal errors.
  • Improved logging in nav2_bt_navigator/src/navigators/navigate_to_pose.cpp to emit error_code and error_msg when goals complete with errors.
  • Added error codes to feedback so clients can distinguish failure modes.

Files changed

  • nav2_bt_navigator/src/navigators/navigate_to_pose.cpp — handle result->error_code and propagate internal error info.

Description of documentation updates required from your changes

  • Document new error_code and error_msg fields in the NavigateToPose action documentation.
  • Add a short troubleshooting section listing common error codes and operator actions.
  • Update the CHANGELOG with "Added error codes to NavigateToPose feedback/result handling."

Description of how this change was tested

  • Built with colcon on Ubuntu 22.04.
  • Ran navigation2 demo in Gazebo and issued NavigateToPose goals:
    • Verified successful goals return error_code == 0.
    • Verified failure paths return error_code != 0, error_msg populated, and logs show populateInternalError warnings.
  • Manual smoke testing only; no automated tests added in this PR.

Future work that may be required in bullet points

  • Add unit/integration tests to verify:
    • Successful navigation sets error_code == 0.
    • Failure paths set error_code != 0 and populateInternalError is invoked.
  • Expand and enum-ify documented error codes with remediation steps.
  • Consider exposing structured status codes in RViz or telemetry tools.

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

@Pana1v Pana1v changed the base branch from main to humble October 8, 2025 16:19
@mergify
Copy link
Contributor

mergify bot commented Oct 8, 2025

@Pana1v, all pull requests must be targeted towards the main development branch.
Once merged into main, it is possible to backport to @humble, but it must be in main
to have these changes reflected into new distributions.

typename ActionT::Result::SharedPtr result,
const nav2_behavior_tree::BtStatus /*final_bt_status*/)
{
if (result->error_code == 0) {
Copy link
Member

@SteveMacenski SteveMacenski Oct 8, 2025

Choose a reason for hiding this comment

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

Error codes and messages do not exist in Humble, thus I think this PR is unfortunately invalid and cannot be merged in any form 😦

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, this is enabled in humble_main, tuned for the next release!.

Closing this PR

@Pana1v Pana1v changed the base branch from humble to humble_main October 8, 2025 19:20
@Pana1v Pana1v changed the base branch from humble_main to humble October 8, 2025 19:21
@Pana1v Pana1v closed this Oct 8, 2025
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