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

[AMCL] 9x initialisation (and reset) speed increase #4941

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

doisyg
Copy link
Contributor

@doisyg doisyg commented Feb 21, 2025


Basic Info

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

Description of contribution in a few bullet points

On VERY big maps, the method map_update_cspace of AMCL takes ages. Which makes AMCL long to start, or reset (when for instance changing a dynamic parameter needing reinit_laser = true)
3 tricks by order of impact:

  • using std::queue instead of std::priority_queue. But this is why this is a draft, I cannot understand why std::priority_queue was needed in the first place (and which criteria it used for ordering), so I am not sure.
  • avoiding one CellData copy with emplace instead of push.
  • computing MAP_INDEX(map, i, j) once instead of twice.

On a big map, AMCL activation times drops from 22s to 2.4s on my machine.

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

Guillaume Doisy added 2 commits February 21, 2025 19:17
Signed-off-by: Guillaume Doisy <[email protected]>
Signed-off-by: Guillaume Doisy <[email protected]>
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
nav2_amcl/src/map/map_cspace.cpp 85.24% <100.00%> (-5.94%) ⬇️

... and 2 files with indirect coverage changes

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.

1 participant