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] Add option to force nomotion update after initialpose #1226

Conversation

stwirth
Copy link
Contributor

@stwirth stwirth commented Nov 28, 2022

  • Adds a new boolean parameter force_update_after_initialpose. When set to true, an update is forced on the next laser scan callback, such as when the /request_nomotion_update service is called. This often results in an improved robot pose after a manual (not very precise) re-localization - without a need for the robot to move.
  • Fixes a bunch of compiler warnings (unused variable now, catching exceptions by value), normalizes how tf exceptions are caught.

When setting the new parameter force_nomotion_update_after_initialpose
is set to true, a filter update is forced after the pose is
re-initialized with a message on /initialpose. This often results in a
better pose right after re-localization, without any motion needed.
@stwirth
Copy link
Contributor Author

stwirth commented Nov 28, 2022

I added another commit to add a second parameter force_update_after_set_map which - when set to true - forces an update after the /set_map service has been used.

@@ -28,6 +28,8 @@ gen.add("beam_skip_distance", double_t, 0, "Distance from a valid map point befo
gen.add("beam_skip_threshold", double_t, 0, "Ratio of samples for which the scans are valid to consider as valid scan", 0.3, 0, 1)

gen.add("tf_broadcast", bool_t, 0, "When true (the default), publish results via TF. When false, do not.", True)
gen.add("force_nomotion_update_after_initialpose", bool_t, 0, "When true, force a pose update after a new /initialpose is received.", False)
gen.add("force_nomotion_update_after_set_map", bool_t, 0, "When true, force a pose update after a new map (and pose) has been set via the /set_map service.", False)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason to include "nomotion" in the names? These are pretty long variable names, and "force_update_after_X" seems to convey exactly what is going on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I'll rename.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mikeferguson mikeferguson merged commit 4122c1b into ros-planning:noetic-devel Nov 29, 2022
@stwirth
Copy link
Contributor Author

stwirth commented Nov 29, 2022

Thanks @mikeferguson!

@stwirth
Copy link
Contributor Author

stwirth commented Jan 10, 2023

@mikeferguson would you be so kind and bloom a noetic release to get this in?

@mikeferguson
Copy link
Contributor

ros/rosdistro#35816

@stwirth
Copy link
Contributor Author

stwirth commented Jan 11, 2023

Awesome, thank you @mikeferguson!

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.

None yet

2 participants