Skip to content

Conversation

@mini-1235
Copy link
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses #4907
Primary OS tested on Ubuntu
Robotic platform tested on Tb4
Does this PR contain AI generated software? No
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

  • Redesign AMCL dynamic parameters pattern

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

@SteveMacenski
Copy link
Member

Otherwise LGTM

@mini-1235
Copy link
Contributor Author

mini-1235 commented Oct 18, 2025

I also noticed that it is better to put

node->add_post_set_parameters_callback
node->add_on_set_parameters_callback

in the activate() stage.

If these callbacks are added during configure() stage, it may cause issues for example when using the rotation shim controller.

Also, we are only checking the value and not the full parameter name here

if (parameter.as_double() < 0.0) {
RCLCPP_WARN(
logger_, "The value of parameter '%s' is incorrectly set to %f, "
"it should be >=0. Ignoring parameter update.",
param_name.c_str(), parameter.as_double());
result.successful = false;
, this might also cause issue when using Rotation Shim, I think

@SteveMacenski
Copy link
Member

in the activate() stage.

Isn't that already the case?

Also, we are only checking the value and not the full parameter name here

Because this should only be addressing the graceful parameters:

if (param_name.find(plugin_name_ + ".") != 0) {
continue;
}
. That line should skip anything that is not in the graceful controller's namespace.

That is fine as long as all double values cannot be negative. That is not generically true, but is for this particular controller's parameters.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
nav2_amcl/src/amcl_node.cpp 88.57% 4 Missing ⚠️
Files with missing lines Coverage Δ
...ude/nav2_graceful_controller/parameter_handler.hpp 100.00% <ø> (ø)
...v2_graceful_controller/src/graceful_controller.cpp 89.47% <100.00%> (+0.12%) ⬆️
nav2_graceful_controller/src/parameter_handler.cpp 98.70% <100.00%> (+0.02%) ⬆️
...ated_pure_pursuit_controller/parameter_handler.hpp 100.00% <ø> (ø)
..._pure_pursuit_controller/src/parameter_handler.cpp 93.62% <100.00%> (+0.07%) ⬆️
...ntroller/src/regulated_pure_pursuit_controller.cpp 85.79% <100.00%> (+0.15%) ⬆️
nav2_amcl/src/amcl_node.cpp 86.31% <88.57%> (+19.54%) ⬆️

... and 9 files with indirect coverage changes

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

@mini-1235
Copy link
Contributor Author

Isn't that already the case?

Yes for AMCL, but not for RPP and Graceful, which is something I have overlooked in my last PR #5600, I fixed this in the latest commit

Why not also skip?

I have added the skip for Graceful, RPP and AMCL. Please take a look again

. That line should skip anything that is not in the graceful controller's namespace.

Let's say my config is:

plugin: "nav2_rotation_shim_controller::RotationShimController"
primary_controller: "nav2_graceful_controller::GracefulController"

Then, Rotation shim and Graceful share the same namespace, so it's not skipped. This is not related to this PR, but something I noticed when refactoring rotation shim

@mini-1235
Copy link
Contributor Author

I cannot find the test directory for AMCL, do I need to increase the code coverage?

@SteveMacenski
Copy link
Member

Then, Rotation shim and Graceful share the same namespace, so it's not skipped. This is not related to this PR, but something I noticed when refactoring rotation shim

Ah... anything we should do about that?

I cannot find the test directory for AMCL, do I need to increase the code coverage?

if you'd like to. Since it was missing in the first place, I would accept just testing it manually to make sure the dynamic parameter updates / rejections work. If you'd like to add a simple test to exercise it, I've be more than happy to have that :-)

@mini-1235
Copy link
Contributor Author

mini-1235 commented Oct 22, 2025

Ah... anything we should do about that?

I don’t have a clean solution in mind.

If we check the full parameter name, it would likely solve the issue(assuming there are no overlapping parameters between the Rotation Shim and other controllers) but that would lead to code duplication.

Alternatively, we could add a namespace for the primary controller, so the plugin_name would be FollowPath.primary_controller. Does that make sense to you?

@SteveMacenski SteveMacenski merged commit 47327a5 into ros-navigation:main Oct 22, 2025
16 checks passed
@mini-1235 mini-1235 deleted the feat/dynamic_amcl_params branch October 22, 2025 18:19
@SteveMacenski
Copy link
Member

That would make sense. We could pass in the name + ".primary_controller" to https://github.com/ros-navigation/navigation2/blob/main/nav2_rotation_shim_controller/src/nav2_rotation_shim_controller.cpp#L112C42-L112C46 so that that is the namespace the controller plugin will look for things within.

We'd just need to update the migration guide / configuration guide for the rotation shim controller to make this clear. Good idea :-)

@mini-1235
Copy link
Contributor Author

We'd just need to update the migration guide / configuration guide for the rotation shim controller to make this clear. Good idea :-)

Ok, will do this week

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.

2 participants