Skip to content
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

nav2_smac_planner: Fix incorrect conversion between costmap and worlrd coordinates #4949

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FrGrQuim
Copy link

The Smac planner computes paths using costmap coordinates (cell indexes).
Therefore, conversions between world coordinates and costmap coordinates are required.
The issue was that the world-to-costmap conversion used a floor approximation, while the costmap-to-world conversion behaved as if a ceil approximation had been used.
As a result, the planner's output was often shifted in the negative direction.
This commit corrects the inconsistency to ensure proper alignment between costmap and world coordinates.


Basic Info

Info Please fill out this column
Ticket(s) this addresses #4735
Primary OS tested on Ubuntu
Robotic platform tested on /
Does this PR contain AI generated software? No

Description of contribution in a few bullet points

  • I fix the bad conversion cotsmap_cell_index->Worlds in SmacPlanner

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

… coordinates

The Smac planner computes paths using costmap coordinates (cell
indexes).
Therefore, conversions between world coordinates and costmap coordinates
are required.
The issue was that the world-to-costmap conversion used a floor
approximation, while the costmap-to-world conversion behaved as if a
ceil approximation had been used.
As a result, the planner's output was often shifted in the negative
direction.
This commit corrects the inconsistency to ensure proper alignment
between costmap and world coordinates.
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.

This was changed in July to supposedly fix the issue in reverse: 137b93b (and that test that was added is now failing in this PR 😉 )

What distribution did you test this against? Main / Rolling / Jazzy is -, but humble / iron is + due to backport conflicts, so it seems like humble/iron are outliers and inconsistent with the current state of the main branches.

I'm therefore wondering if this change is actually correct. I think perhaps you need to invert that in Humble / Iron that you're using and the main change is incorrect. Or, do you think the previous PR to change it that's in Main/Rolling/Jazzy is wrong? Its worth pausing and having that conversation since your issue reports using iron but this PR is against main. I'm wondering if you inverted them in iron to fix it, but then submitted the inversion in main assuming that they were the same (and they're not; apparently).

Please test and let me know :-) If the right answer is to fix Iron / Humble, submitting PRs with the compliment of this change there should be easy for me to merge. I don't typically accept new PRs for EOL distributions (Iron), but I will in this case since this is presumably a mathematical error

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.

SmacPlanner hybrid can generate path that pass inside lethal area
2 participants