Skip to content

Conversation

leander-dsouza
Copy link
Contributor

@leander-dsouza leander-dsouza commented Oct 7, 2025


Basic Info

Info Please fill out this column
Ticket(s) this addresses #5299
Primary OS tested on Ubuntu
Robotic platform tested on N/A
Does this PR contain AI-generated software? No
Was this PR description generated by AI software? N/A

Description of contribution in a few bullet points

  • Added the missing definition of declare_or_get_parameter without the default value to the lifecycle node.
  • Migrated the get_parameter and declare_parameter fields to use the new declare_or_get_parameter API for nav2_collision_monitor.
  • Migrated the rclcpp::exceptions::ParameterUninitializedException to rclcpp::exceptions::InvalidParameterValueException to match the exception raised in declare_or_get_parameter if the default value is not set.
  • Removed redundant set_parameter() calls when preceeded by declare_parameter.

Description of documentation updates required from your changes

  • N/A

Description of how this change was tested

  • Performed linting validation using pre-commit run --all and testing locally using colcon test

Future work that may be required in bullet points

  • N/A

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

@leander-dsouza leander-dsouza marked this pull request as ready for review October 7, 2025 03:21
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
nav2_collision_monitor/src/circle.cpp 94.33% <100.00%> (-0.11%) ⬇️
..._collision_monitor/src/collision_detector_node.cpp 97.22% <100.00%> (-0.33%) ⬇️
...2_collision_monitor/src/collision_monitor_node.cpp 96.96% <100.00%> (-0.27%) ⬇️
nav2_collision_monitor/src/pointcloud.cpp 79.66% <100.00%> (-2.16%) ⬇️
nav2_collision_monitor/src/polygon.cpp 96.99% <100.00%> (-0.31%) ⬇️
nav2_collision_monitor/src/polygon_source.cpp 94.73% <100.00%> (-0.10%) ⬇️
nav2_collision_monitor/src/range.cpp 94.87% <100.00%> (-0.13%) ⬇️
nav2_collision_monitor/src/source.cpp 98.14% <100.00%> (-0.16%) ⬇️
nav2_collision_monitor/src/velocity_polygon.cpp 96.55% <100.00%> (-0.75%) ⬇️
..._common/include/nav2_ros_common/lifecycle_node.hpp 92.30% <100.00%> (+0.17%) ⬆️

... and 11 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.

Also, can use we a node->declare_or_get_parameter()API instead ofnav2::declare_or_get_parameter(node, ...)`? If that's not in the node wrapped capabilities, it might be good to add that.

Can you also expand on the test changes?

@leander-dsouza leander-dsouza force-pushed the new_param_api-nav2_collision_monitor branch from bf3a2dd to 18cd86b Compare October 8, 2025 06:17
@leander-dsouza
Copy link
Contributor Author

Also, can use we a node->declare_or_get_parameter()API instead ofnav2::declare_or_get_parameter(node, ...)`? If that's not in the node wrapped capabilities, it might be good to add that.

I have added the missing definition of declare_or_get_parameter without the default value to the lifecycle node.

Can you also expand on the test changes?

I have removed all set_parameter() calls that are preceded by calls to declare_parameter(), as these are redundant and are already set in declare_parameter(). In essence, the parameter is already set in the declare_parameter() call.

@leander-dsouza leander-dsouza force-pushed the new_param_api-nav2_collision_monitor branch from 18cd86b to 887f016 Compare October 13, 2025 08:52
@leander-dsouza leander-dsouza marked this pull request as draft October 13, 2025 09:10
@leander-dsouza leander-dsouza changed the title Use the new_declare_or_get_parameter API for nav2_collision_monitor. Update new_declare_or_get_parameter API for collision_monitor and map_server Oct 13, 2025
@leander-dsouza leander-dsouza force-pushed the new_param_api-nav2_collision_monitor branch 2 times, most recently from 54b1023 to ace49b9 Compare October 13, 2025 10:24
@leander-dsouza leander-dsouza force-pushed the new_param_api-nav2_collision_monitor branch from ace49b9 to 5efd816 Compare October 13, 2025 10:25
@leander-dsouza leander-dsouza marked this pull request as ready for review October 13, 2025 10:45
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.

Generally LGTM!

@SteveMacenski SteveMacenski merged commit 568174c into ros-navigation:main Oct 14, 2025
19 of 20 checks passed
Jad-ELHAJJ pushed a commit to Jad-ELHAJJ/navigation2 that referenced this pull request Oct 16, 2025
…_server (ros-navigation#5588)

* Use the new_declare_or_get_parameter API for nav2_collision_monitor.

Signed-off-by: Leander Stephen D'Souza <[email protected]>

* Removed redundant set_parameter calls when preceeded by declare_parameter.

Signed-off-by: Leander Stephen D'Souza <[email protected]>

* Use declare_or_get_parameter without a default value.

Signed-off-by: Leander Stephen D'Souza <[email protected]>

* Simplified definitions that required to determine parameter type from template.

Signed-off-by: Leander Stephen D'Souza <[email protected]>

* Removed self-definition of node_utils.hpp.

Signed-off-by: Leander Stephen D'Souza <[email protected]>

* Address PR feedback: Remove unnecessary linebreaks and improve param docstring.

Signed-off-by: Leander Stephen D'Souza <[email protected]>

---------

Signed-off-by: Leander Stephen D'Souza <[email protected]>
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