Repository navigation
test: fix the tests on ROS 2 Lyrical - #552
Merged
Merged
Conversation
Lyrical removes tf2/transform_datatypes.h and deprecates tf2_ros/transform_broadcaster.h, tf2_ros/transform_listener.h and ament_index_cpp::get_package_share_directory. The tests build with -Werror, so the tests of grid_map_costmap_2d and grid_map_pcl no longer compile. Use the .hpp headers and get_package_share_path. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
Nav2 now returns the full map size from Costmap2D::getSizeInMetersX and getSizeInMetersY (ros-navigation/navigation2 PR 6028). The test expected half a cell less. Costmap2DROS now declares most parameters in on_configure(), so set_parameter() before configure() throws. Pass the values as parameter overrides, through the constructor that keeps the NodeOptions. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
This was referenced Nov 13, 2026
The NodeOptions constructor of Costmap2DROS uses the root namespace, so all test costmaps shared the topics /costmap and /footprint and the clear services. Remap the namespace to /<name>, as the name constructor did. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
The comment described the old set_parameter() setup. test_helpers.hpp does not use ament_index_cpp, and test_helpers.cpp includes it itself. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
xmfcx
marked this pull request as ready for review
November 13, 2026 16:17
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR fixes the tests of
grid_map_costmap_2dandgrid_map_pclon ROS 2 Lyrical. Four commits:.hppheaders oftf2andtf2_ros, andament_index_cpp::get_package_share_path, in the tests.grid_map_costmap_2dtests for Nav2 changes:Costmap2DROSgets its parameters as parameter overrides, not throughset_parameter()./<name>, as before.The packages also need the build fixes, and the two PRs must merge together:
Why
tf2/transform_datatypes.hand deprecates thetf2_ros.hheaders andament_index_cpp::get_package_share_directory. The tests build with-Werror, so they do not compile.Costmap2D::getSizeInMetersXandgetSizeInMetersYnow return the full map size. The test expected half a cell less.Costmap2DROSnow declares most parameters inon_configure(), soset_parameter()beforeconfigure()throws:parameter 'plugins' cannot be set because it was not declared.NodeOptionsconstructor ofCostmap2DROSkeeps the parameter overrides, and it uses the root namespace. Without the remap, all test costmaps share the topics/costmapand/footprintand the clear services.The two Nav2 changes:
The converter code uses the cell count and the resolution, not
getSizeInMeters, so the Nav2 change does not affect it. Jazzy and Kilted still use the old Nav2 size, so a backport of commit 2 to their branches needs the old expectation.How it was tested
colcon testgave841 tests, 0 errors, 0 failures, 195 skipped. All skipped tests arecppcheck.colcon test-resultreported 12 failures ingrid_map_costmap_2d.