-
Notifications
You must be signed in to change notification settings - Fork 270
added documentation for symmetric_yaw_tolerance #827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
18d2430
added documentation for symmetric_yaw_tolerance
sandeepdutta 576936b
added documentation for symmetric_yaw_tolerance
sandeepdutta 78d2519
Update migration/Humble.rst
SteveMacenski 860c44b
Update configuration/index.rst
SteveMacenski cc2560b
Update configuration/packages/configuring-mppic.rst
SteveMacenski e7365fb
Update configuration/packages/nav2_controller-plugins/simple_goal_che…
SteveMacenski 18ab234
Update configuration/packages/symmetric_yaw_tolerance.rst
SteveMacenski fc833d4
Update tuning/index.rst
SteveMacenski 6c60a69
Update tuning/index.rst
SteveMacenski a922b45
Revise section titles and numbers in distribution_release.rst (#828)
SteveMacenski e5031a2
updated Fixed PR comments
sandeepdutta 0f18c46
updated to fix pre-commit failure
sandeepdutta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| .. _symmetric_yaw_tolerance_guide: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This page can be removed now, moved to tuning |
||
|
|
||
| Symmetric Yaw Tolerance for Goal Checking and Navigation | ||
| ######################################################### | ||
|
SteveMacenski marked this conversation as resolved.
Outdated
|
||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| The **symmetric_yaw_tolerance** parameter enables symmetric robots (that can drive equally well in both forward and backward directions) to reach goals without unnecessary 180° rotations. This feature is available in: | ||
|
|
||
| - **GoalAngleCritic** (MPPI Controller) - for trajectory cost evaluation | ||
| - **SimpleGoalChecker** (Controller Server) - for goal achievement detection | ||
|
|
||
| When enabled, these plugins accept either the goal orientation or the goal orientation + 180°, preventing the robot from wasting time and energy rotating when it could simply drive backward. | ||
|
|
||
| Use Case | ||
| ******** | ||
|
|
||
| This feature is ideal for robots with symmetric mechanical designs, such as: | ||
|
|
||
| - Differential drive robots with sensors on both ends | ||
| - Robots with bidirectional capabilities | ||
|
|
||
| Without this feature, a standard goal checker or goal angle critic would force the robot to rotate 180° if it approaches the goal from the "wrong" direction, even when the robot could simply drive backward to the goal. | ||
|
|
||
| How It Works | ||
| ************ | ||
|
|
||
| When ``symmetric_yaw_tolerance: true`` is set: | ||
|
|
||
| **In GoalAngleCritic (MPPI Controller):** | ||
| The critic calculates the angular distance to both the goal orientation and the flipped goal orientation (goal + 180°), then uses the minimum of these two distances for trajectory scoring. This allows trajectories approaching from either direction to have lower costs. | ||
|
|
||
| **In SimpleGoalChecker (Controller Server):** | ||
| The goal checker returns true if the robot is within tolerance of either orientation - the exact goal orientation OR the goal orientation + 180°. | ||
|
|
||
| This allows the robot to: | ||
|
|
||
| 1. Approach the goal from either direction without penalty | ||
| 2. Avoid unnecessary rotations when already facing away from the goal orientation | ||
| 3. Select the most efficient trajectory based on current orientation | ||
| 4. Accept goal achievement when facing backward (goal ± 180°) | ||
|
|
||
| Enabling the Feature | ||
| ******************** | ||
|
|
||
| To enable symmetric yaw tolerance for your robot: | ||
|
|
||
| **In the Goal Checker:** | ||
|
|
||
| Add ``symmetric_yaw_tolerance: true`` to your SimpleGoalChecker configuration: | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| controller_server: | ||
| ros__parameters: | ||
| goal_checker_plugins: ["goal_checker"] | ||
| goal_checker: | ||
| plugin: "nav2_controller::SimpleGoalChecker" | ||
| xy_goal_tolerance: 0.15 | ||
| yaw_goal_tolerance: 0.15 | ||
| symmetric_yaw_tolerance: true | ||
|
|
||
| **In the MPPI Controller:** | ||
|
|
||
| Add ``symmetric_yaw_tolerance: true`` to your GoalAngleCritic configuration: | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| controller_server: | ||
| ros__parameters: | ||
| FollowPath: | ||
| plugin: "nav2_mppi_controller::MPPIController" | ||
|
|
||
| critics: | ||
| - "GoalAngleCritic" | ||
|
|
||
| GoalAngleCritic: | ||
| cost_weight: 5.0 | ||
| cost_power: 1 | ||
| threshold_to_consider: 0.4 | ||
| symmetric_yaw_tolerance: true | ||
|
|
||
| **Complete Example:** | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| controller_server: | ||
| ros__parameters: | ||
| use_sim_time: false | ||
| controller_frequency: 30.0 | ||
|
|
||
| # Goal checker with symmetric support | ||
| goal_checker_plugins: ["goal_checker"] | ||
| goal_checker: | ||
| plugin: "nav2_controller::SimpleGoalChecker" | ||
| xy_goal_tolerance: 0.15 | ||
| yaw_goal_tolerance: 0.15 | ||
| stateful: true | ||
| symmetric_yaw_tolerance: true | ||
|
|
||
| # Controller with symmetric support | ||
| controller_plugins: ["FollowPath"] | ||
| FollowPath: | ||
| plugin: "nav2_mppi_controller::MPPIController" | ||
| time_steps: 56 | ||
| model_dt: 0.05 | ||
| batch_size: 2000 | ||
| motion_model: "DiffDrive" | ||
|
|
||
| critics: | ||
| - "ConstraintCritic" | ||
| - "GoalCritic" | ||
| - "GoalAngleCritic" | ||
| - "PathAlignCritic" | ||
|
|
||
| ConstraintCritic: | ||
| cost_weight: 4.0 | ||
| GoalCritic: | ||
| cost_weight: 5.0 | ||
| threshold_to_consider: 1.4 | ||
| GoalAngleCritic: | ||
| cost_weight: 5.0 | ||
| threshold_to_consider: 0.4 | ||
| symmetric_yaw_tolerance: true | ||
| PathAlignCritic: | ||
| cost_weight: 10.0 | ||
|
|
||
| Configuration Options | ||
| ********************* | ||
|
|
||
| Both plugins can be configured independently. You can enable one, the other, or both depending on your needs: | ||
|
|
||
| **Only Goal Checker Enabled:** | ||
| The robot accepts goals as reached when facing either direction (goal or goal ± 180°), but trajectory planning doesn't prefer the backward approach. Useful if you want goal flexibility without trajectory planning changes. | ||
|
|
||
| **Only Goal Angle Critic Enabled:** | ||
| The trajectory planner prefers minimal rotation and approaches that minimize angle difference, but the goal is only marked as reached in the exact orientation. Useful for partial trajectory optimization. | ||
|
|
||
| **Both Enabled:** | ||
| Complete symmetric support - trajectory planning prefers efficient approach AND goal acceptance is orientation-agnostic. **Recommended** for full symmetric robot support. | ||
|
|
||
| **Expected Behavior:** | ||
|
|
||
| - With ``symmetric_yaw_tolerance: true``, the robot should accept goals when approaching from either direction | ||
| - GoalAngleCritic should prefer minimal rotation when within threshold_to_consider | ||
| - Robot should achieve goal without unnecessary 180° rotations | ||
|
|
||
| Related Documentation | ||
| ********************* | ||
|
|
||
| - :ref:`configuring_mppic` - MPPI Controller configuration guide | ||
| - :ref:`configuring_controller_server` - Controller Server configuration guide | ||
| - `Nav2 MPPI Controller Documentation <https://navigation.ros.org/configuration/packages/configuring-mppi.html>`_ | ||
| - `Nav2 Goal Checker Plugins <https://navigation.ros.org/configuration/packages/configuring-controller-server.html#goal-checker-plugins>`_ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead, we should add this to the tuning guide as a subpage under a header for Symmetric Navigation https://docs.nav2.org/tuning/index.html
I'd make sure to mention loudly and prominently this ROSCon talk on the subject: https://vimeo.com/879000809. I don't think most users for bidirectional need the implementation you've suggested. His work makes Nav2 fully bidirectional in terms of motion in the planners / controllers for motion -- but does care about the final orientation. Yours is adding not caring about the goal completion orientation, which is a special subcase of that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved section to tuning guide as suggested. Thank you for link to the video, I watched it.
I am using "Theta Star" planner, I found that by using this planner and MPPI controller with "PreferForwardCritic"
disabled and "PathAngleCritic" forward_preference = false, the robot moves in a very optimal way , it chooses
backwards or forwards depending on the current orientation and desired direction of travel, it was reorienting at the goal position , which this change fixes. In fact I am not sure why the path inversion (as described in the video) is required if the robot is truly bidirectional. Maybe I am missing something