Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Jun 17, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5273
Primary OS tested on (Ubuntu 24.04)
Robotic platform tested on (TB4 Simulation)
Does this PR contain AI generated software? (Yes)

Description of contribution in a few bullet points

  • Modified onGoalExit() in nav2_controller to accept a bool force_stop argument.
  • Ensured that a zero velocity is always published in cases of failure or exception, regardless of the publish_zero_velocity parameter setting.
  • Improves safety behavior by guaranteeing that the robot stops on controller failure, cancellation, or internal exception.
  • Updated all exit points in computeControl() to call onGoalExit(true) on failure and onGoalExit(false) on success.

Description of documentation updates required from your changes

  • No new parameters introduced.
  • Minor clarification could be added to the publish_zero_velocity parameter documentation:

    This parameter only affects zero-velocity publishing on successful goal completion. Failures or cancellations will now always publish zero velocity regardless of this setting.

Description of testing

Tested using the Nav2 TurtleBot4 simulation:

ros2 launch nav2_bringup tb4_simulation_launch.py headless:=False
  • Sent a navigation goal via RViz, then canceled it mid-execution.
  • Verified that /cmd_vel_nav published a zero velocity immediately after cancellation:
ros2 topic echo /cmd_vel_nav 
  • Confirmed that a zero velocity was sent even when publish_zero_velocity := false.

Future work that may be required in bullet points

  • Consider introducing an explicit always_stop_on_failure parameter for full user control over emergency stop policy.

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

This is an automatic backport of pull request #5279 done by [Mergify](https://mergify.com).

Signed-off-by: haider8645 <haider_lodhi@hotmail.com>
(cherry picked from commit 22d8d91)
@mergify
Copy link
Contributor Author

mergify bot commented Jun 17, 2025

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

@SteveMacenski SteveMacenski merged commit 4d82ef3 into kilted Jun 17, 2025
7 of 10 checks passed
@SteveMacenski SteveMacenski deleted the mergify/bp/kilted/pr-5279 branch June 17, 2025 17:42
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.

3 participants