Skip to content

Conversation

@leander-dsouza
Copy link
Contributor


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

  • Migrated the get_parameter and declare_parameter fields to use the new declare_or_get_parameter API for nav2_costmap_2d.
  • Partially migrated the parameters in costmap_2d_ros.cpp, as the test setup requires these parameters to be declared in the init() function.
  • Removed redundant set_parameter() calls in the tests that are followed by declare_parameter calls.

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

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
Copy link
Contributor Author

Should I replace the Layer's declareParameter() calls as well?

I have tried replacing all node->get_parameter() calls that precede declareParameter() with node->declare_or_get_parameter(), and all the tests pass locally.

@leander-dsouza leander-dsouza force-pushed the new_param_api-nav2_costmap_2d branch from c12057b to aabe5bc Compare October 27, 2025 12:12
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
nav2_costmap_2d/plugins/plugin_container_layer.cpp 98.76% <100.00%> (-0.08%) ⬇️
nav2_costmap_2d/src/costmap_2d_ros.cpp 86.41% <100.00%> (-0.14%) ⬇️

... and 7 files with indirect coverage changes

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

@leander-dsouza leander-dsouza marked this pull request as ready for review October 27, 2025 13:03
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