Skip to content

Conversation

mini-1235
Copy link
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5425
Primary OS tested on Ubuntu
Robotic platform tested on
Does this PR contain AI generated software? Some of the test cases are written by AI
Was this PR description generated by AI software? Out of respect for maintainers, AI for human-to-human communications are banned

Description of contribution in a few bullet points

Description of documentation updates required from your changes

Description of how this change was tested


Future work that may be required in bullet points

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-*.

theta = atan2(dy, dx);
pt_yaw = tf2::getYaw(path.poses[1].pose.orientation);
if (fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) {
if (!is_holonomic && fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) {
Copy link
Contributor Author

@mini-1235 mini-1235 Sep 19, 2025

Choose a reason for hiding this comment

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

When writing the unit tests, I find this block confusing 🤕
I don't understand why only idx 2 and idx 1 are checked for the reverse segments, can't the reverse segment be in the middle or the end of the path?

Copy link
Member

Choose a reason for hiding this comment

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

This function is run on path segments that have already been segmented by orientation changes, so we know they should all be in the same direction before this function is called. This is to check whether this already segmented path segment is forward or reversing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for asking a lot of questions, I will go through the code in Planner and Smoother again once I have done the controller stuffs

theta = atan2(dy, dx);
pt_yaw = tf2::getYaw(path.poses[1].pose.orientation);
if (fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) {
if (!is_holonomic && fabs(angles::shortest_angular_distance(pt_yaw, theta)) > M_PI_2) {
Copy link
Member

Choose a reason for hiding this comment

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

This function is run on path segments that have already been segmented by orientation changes, so we know they should all be in the same direction before this function is called. This is to check whether this already segmented path segment is forward or reversing

@SteveMacenski
Copy link
Member

Check out the failing test in CI, otherwise LGTM!

mini-1235 and others added 3 commits September 20, 2025 14:38
Co-authored-by: Steve Macenski <[email protected]>
Signed-off-by: mini-1235 <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
Signed-off-by: mini-1235 <[email protected]>
Signed-off-by: Maurice <[email protected]>
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
...mac_planner/include/nav2_smac_planner/smoother.hpp 100.00% <ø> (ø)
nav2_smac_planner/src/smoother.cpp 96.85% <100.00%> (+2.35%) ⬆️
.../include/nav2_smoother/savitzky_golay_smoother.hpp 100.00% <ø> (ø)
...smoother/include/nav2_smoother/simple_smoother.hpp 100.00% <ø> (ø)
nav2_smoother/src/savitzky_golay_smoother.cpp 98.50% <100.00%> (ø)
nav2_smoother/src/simple_smoother.cpp 100.00% <100.00%> (ø)
nav2_util/include/nav2_util/smoother_utils.hpp 97.56% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

I think you said you were going to get back to me with something in #5537 (comment). Is this now ready to merge?

@mini-1235
Copy link
Contributor Author

I think this is ready to merge, and we can close #5435 for now. I will take a closer look at the planner and smoother code after #5446 is done, and I will let you know if I ran into any issues

@SteveMacenski SteveMacenski merged commit 16e63a4 into ros-navigation:main Sep 24, 2025
18 checks passed
@mini-1235 mini-1235 deleted the refactor/planner_and_smoother branch September 24, 2025 16:01
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.

Is it still necessary to store smoother.cpp file at nav2_smac_planner?
2 participants