From b6cb1097ac192c24fefb539417ea68c999ef211e Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu Date: Sun, 19 Jul 2026 18:05:14 +1000 Subject: [PATCH 01/23] Remove deprecated Eigen empty struct constructors This upstreams RoboStack downstream patch `patch/ros-rolling-grid-map-core.patch`. Best-guess rationale: Eigen's EIGEN_EMPTY_STRUCT_CTOR macro is no longer needed for these stateless functors and can trigger compatibility issues with newer Eigen/toolchain combinations. Signed-off-by: Tobias Fischer (cherry picked from commit f911bbd0ef654ee8d4614eff1baf5163fc07751c) --- .../include/grid_map_core/eigen_plugins/FunctorsPlugin.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/grid_map_core/include/grid_map_core/eigen_plugins/FunctorsPlugin.hpp b/grid_map_core/include/grid_map_core/eigen_plugins/FunctorsPlugin.hpp index b5c3abba0..5988361e4 100644 --- a/grid_map_core/include/grid_map_core/eigen_plugins/FunctorsPlugin.hpp +++ b/grid_map_core/include/grid_map_core/eigen_plugins/FunctorsPlugin.hpp @@ -6,7 +6,6 @@ template struct scalar_sum_of_finites_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_sum_of_finites_op) EIGEN_STRONG_INLINE const Scalar operator()(const Scalar & a, const Scalar & b) const { using std::isfinite; @@ -29,7 +28,6 @@ struct functor_traits> template struct scalar_min_of_finites_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_min_of_finites_op) EIGEN_STRONG_INLINE const Scalar operator()(const Scalar & a, const Scalar & b) const { using std::min; @@ -53,7 +51,6 @@ struct functor_traits> template struct scalar_max_of_finites_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_max_of_finites_op) EIGEN_STRONG_INLINE const Scalar operator()(const Scalar & a, const Scalar & b) const { using std::max; From 8899d7a29f0cccb81707497a807230a01aed8adb Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu Date: Sun, 19 Jul 2026 18:05:14 +1000 Subject: [PATCH 02/23] Default copy operations for grid_map_core types This upstreams RoboStack downstream patch `patch/ros-rolling-grid-map-core.osx.patch`. Best-guess rationale: explicitly defaulting copy construction and assignment keeps BufferRegion and Polygon usable in containers on toolchains that are stricter around implicit special member generation with aligned Eigen types. Signed-off-by: Tobias Fischer (cherry picked from commit 99e772191f891c5a647bb44c67a78ad083f415bb) --- grid_map_core/include/grid_map_core/BufferRegion.hpp | 2 ++ grid_map_core/include/grid_map_core/Polygon.hpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/grid_map_core/include/grid_map_core/BufferRegion.hpp b/grid_map_core/include/grid_map_core/BufferRegion.hpp index fbe2d205d..873b4b62a 100644 --- a/grid_map_core/include/grid_map_core/BufferRegion.hpp +++ b/grid_map_core/include/grid_map_core/BufferRegion.hpp @@ -39,6 +39,8 @@ class BufferRegion BufferRegion( const Index & startIndex, const Size & size, const BufferRegion::Quadrant & quadrant); + BufferRegion(const BufferRegion & other) = default; + BufferRegion & operator=(const BufferRegion & other) = default; virtual ~BufferRegion() = default; const Index & getStartIndex() const; diff --git a/grid_map_core/include/grid_map_core/Polygon.hpp b/grid_map_core/include/grid_map_core/Polygon.hpp index 9d7ad27a0..a02b1334a 100644 --- a/grid_map_core/include/grid_map_core/Polygon.hpp +++ b/grid_map_core/include/grid_map_core/Polygon.hpp @@ -40,6 +40,9 @@ class Polygon */ explicit Polygon(std::vector vertices); + Polygon(const Polygon & other) = default; + Polygon & operator=(const Polygon & other) = default; + /*! * Destructor. */ From b7bff87b66dd743c8f7033fe7181cedb4488b4d1 Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu Date: Sun, 19 Jul 2026 20:01:33 +1000 Subject: [PATCH 03/23] Match grid_map_pcl timer clock type This upstreams a generalized form of RoboStack build fix patch/ros-rolling-grid-map-pcl.osx.patch. Best guess rationale: processPointcloud records the start time with std::chrono::high_resolution_clock::now(), but the helper accepted a system_clock time_point. Matching the helper parameter to the clock used by the caller avoids implementation-dependent clock type mismatches, including libc++ configurations where high_resolution_clock is not system_clock. Signed-off-by: Tobias Fischer (cherry picked from commit 1ebb26a6453dde5405bdc4be3680560d66dd1f47) --- grid_map_pcl/include/grid_map_pcl/helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grid_map_pcl/include/grid_map_pcl/helpers.hpp b/grid_map_pcl/include/grid_map_pcl/helpers.hpp index f3d9f38af..785ab94c6 100644 --- a/grid_map_pcl/include/grid_map_pcl/helpers.hpp +++ b/grid_map_pcl/include/grid_map_pcl/helpers.hpp @@ -42,7 +42,7 @@ void saveGridMap( const std::string & mapTopic); inline void printTimeElapsedToRosInfoStream( - const std::chrono::system_clock::time_point & start, + const std::chrono::high_resolution_clock::time_point & start, const std::string & prefix, const rclcpp::Logger & node_logger) { From 3ceb9c447d34160d70419b5dbd51dd9e13b1ece8 Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu Date: Sat, 14 Nov 2026 03:59:04 +0900 Subject: [PATCH 04/23] fix(grid_map_cv): use the cv::COLOR_* constants OpenCV 5 removed the C constants CV_BGR2GRAY, CV_BGRA2GRAY and CV_BGRA2RGB, so GridMapCvConverter.hpp does not compile with it. conda-forge ships OpenCV 5, and RoboStack carries this change as a patch for Lyrical. The cv::COLOR_* constants also exist in OpenCV 3 and 4. Co-Authored-By: Claude Opus 5.5 --- grid_map_cv/include/grid_map_cv/GridMapCvConverter.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grid_map_cv/include/grid_map_cv/GridMapCvConverter.hpp b/grid_map_cv/include/grid_map_cv/GridMapCvConverter.hpp index 233c28a0d..b1aac7665 100644 --- a/grid_map_cv/include/grid_map_cv/GridMapCvConverter.hpp +++ b/grid_map_cv/include/grid_map_cv/GridMapCvConverter.hpp @@ -87,9 +87,9 @@ class GridMapCvConverter cv::Mat imageMono; if (isColor && !hasAlpha) { - cv::cvtColor(image, imageMono, CV_BGR2GRAY); + cv::cvtColor(image, imageMono, cv::COLOR_BGR2GRAY); } else if (isColor && hasAlpha) { - cv::cvtColor(image, imageMono, CV_BGRA2GRAY); + cv::cvtColor(image, imageMono, cv::COLOR_BGRA2GRAY); } else if (!isColor && !hasAlpha) { imageMono = image; } else { @@ -156,7 +156,7 @@ class GridMapCvConverter cv::Mat imageRGB; if (hasAlpha) { - cv::cvtColor(image, imageRGB, CV_BGRA2RGB); + cv::cvtColor(image, imageRGB, cv::COLOR_BGRA2RGB); } else { imageRGB = image; } From 81459fc9a6eae232895a1919554169f90129876b Mon Sep 17 00:00:00 2001 From: Antti Andreimann Date: Mon, 10 Aug 2026 21:48:51 +0300 Subject: [PATCH 05/23] Use imported targets in grid_map_ros Replace ament_target_dependencies with explicit imported-target linking for the grid_map_ros library. The Lyrical ament toolchain no longer accepts the legacy SYSTEM dependency expansion used here. Linking the exported ROS interface targets directly preserves transitive include paths and libraries, while retaining grid_map_cv's legacy variables until that package exports an imported target. This change allows grid_map_ros 2.4.0 to build on ROS 2 Lyrical and removes the need for downstream CMake patches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 99a0dabf0e3cd59020acfadbdeea128fe1ab76b6) --- grid_map_ros/CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/grid_map_ros/CMakeLists.txt b/grid_map_ros/CMakeLists.txt index 2a75ce805..dbddac6fa 100644 --- a/grid_map_ros/CMakeLists.txt +++ b/grid_map_ros/CMakeLists.txt @@ -56,8 +56,25 @@ add_library(${PROJECT_NAME} SHARED src/PolygonRosConverter.cpp ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM - ${dependencies} +target_link_libraries(${PROJECT_NAME} PUBLIC + cv_bridge::cv_bridge + grid_map_core::grid_map_core + rclcpp::rclcpp + rcutils::rcutils + rosbag2_cpp::rosbag2_cpp + tf2::tf2 + ${geometry_msgs_TARGETS} + ${grid_map_msgs_TARGETS} + ${nav2_msgs_TARGETS} + ${nav_msgs_TARGETS} + ${sensor_msgs_TARGETS} + ${std_msgs_TARGETS} + ${visualization_msgs_TARGETS} + ${grid_map_cv_LIBRARIES} +) + +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + ${grid_map_cv_INCLUDE_DIRS} ) ############# From 1697d1c376da8111de5a60fce0fa01bd9995580c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 17:01:33 +0300 Subject: [PATCH 06/23] fix: use target_link_libraries instead of ament_target_dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ROS 2 Lyrical removed ament_target_dependencies (ament/ament_cmake#614). CMake then stops with: Unknown CMake command "ament_target_dependencies". Dependencies that export CMake targets link the targets. The grid_map packages that export only variables use _LIBRARIES and _INCLUDE_DIRS, which is what ament_target_dependencies did. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit e3efbf99c5367a1b534de7ffd0dac0c5e82c6a6e) --- grid_map_demos/CMakeLists.txt | 88 ++++++++++++--------------- grid_map_filters/CMakeLists.txt | 13 +++- grid_map_loader/CMakeLists.txt | 13 ++-- grid_map_octomap/CMakeLists.txt | 9 ++- grid_map_pcl/CMakeLists.txt | 17 +++--- grid_map_rviz_plugin/CMakeLists.txt | 14 ++++- grid_map_sdf/CMakeLists.txt | 5 +- grid_map_visualization/CMakeLists.txt | 20 +++--- 8 files changed, 100 insertions(+), 79 deletions(-) diff --git a/grid_map_demos/CMakeLists.txt b/grid_map_demos/CMakeLists.txt index e64cf57ee..362436b2f 100644 --- a/grid_map_demos/CMakeLists.txt +++ b/grid_map_demos/CMakeLists.txt @@ -24,10 +24,10 @@ find_package(OpenCV REQUIRED grid_map_package() -set(dependencies - grid_map_msgs - grid_map_ros - rclcpp +set(demo_libraries + rclcpp::rclcpp + ${grid_map_msgs_TARGETS} + ${grid_map_ros_LIBRARIES} ) ########### @@ -40,6 +40,9 @@ include_directories( include SYSTEM ${EIGEN3_INCLUDE_DIR} + ${grid_map_cv_INCLUDE_DIRS} + ${grid_map_octomap_INCLUDE_DIRS} + ${grid_map_ros_INCLUDE_DIRS} ) ## Declare a cpp executable @@ -112,76 +115,61 @@ add_executable( ) ## Specify libraries to link a library or executable target against -ament_target_dependencies( - simple_demo SYSTEM - ${dependencies} +target_link_libraries(simple_demo PRIVATE + ${demo_libraries} ) -ament_target_dependencies( - tutorial_demo SYSTEM - ${dependencies} +target_link_libraries(tutorial_demo PRIVATE + ${demo_libraries} ) -ament_target_dependencies( - iterators_demo SYSTEM - ${dependencies} +target_link_libraries(iterators_demo PRIVATE + ${demo_libraries} ) -ament_target_dependencies(image_to_gridmap_demo SYSTEM - ${dependencies} +target_link_libraries(image_to_gridmap_demo PRIVATE + ${demo_libraries} ) -ament_target_dependencies( - octomap_to_gridmap_demo SYSTEM - ${dependencies} - grid_map_octomap - octomap_msgs +target_link_libraries(octomap_to_gridmap_demo PRIVATE + ${demo_libraries} + ${grid_map_octomap_LIBRARIES} + ${octomap_msgs_TARGETS} ) -ament_target_dependencies( - move_demo SYSTEM - ${dependencies} +target_link_libraries(move_demo PRIVATE + ${demo_libraries} ) -ament_target_dependencies( - iterator_benchmark SYSTEM - grid_map_core +target_link_libraries(iterator_benchmark PRIVATE + grid_map_core::grid_map_core ) -ament_target_dependencies( - opencv_demo SYSTEM - ${dependencies} - grid_map_cv +target_link_libraries(opencv_demo PRIVATE + ${demo_libraries} + ${grid_map_cv_LIBRARIES} ) -ament_target_dependencies( - resolution_change_demo SYSTEM - ${dependencies} +target_link_libraries(resolution_change_demo PRIVATE + ${demo_libraries} ) -target_link_libraries(filters_demo filters_demo_lib) - -ament_target_dependencies( - filters_demo_lib SYSTEM - ${dependencies} - filters +target_link_libraries(filters_demo_lib PUBLIC + ${demo_libraries} + ${filters_TARGETS} ) -ament_target_dependencies( - filters_demo SYSTEM - ${dependencies} - filters +target_link_libraries(filters_demo PRIVATE + filters_demo_lib ) -ament_target_dependencies( - normal_filter_comparison_demo SYSTEM - ${dependencies} - filters +target_link_libraries(normal_filter_comparison_demo PRIVATE + ${demo_libraries} + ${filters_TARGETS} ) -ament_target_dependencies( - interpolation_demo SYSTEM - ${dependencies} +target_link_libraries(interpolation_demo PRIVATE + ${demo_libraries} ) set(targets_list diff --git a/grid_map_filters/CMakeLists.txt b/grid_map_filters/CMakeLists.txt index 711302f25..36e9afb80 100644 --- a/grid_map_filters/CMakeLists.txt +++ b/grid_map_filters/CMakeLists.txt @@ -83,8 +83,17 @@ add_library(set_basic_layers_filter SHARED src/SetBasicLayersFilter.cpp) add_library(buffer_normalizer_filter SHARED src/BufferNormalizerFilter.cpp) foreach(lib_name ${filter_libs}) - ament_target_dependencies(${lib_name} SYSTEM - ${dependencies} + target_link_libraries(${lib_name} PUBLIC + grid_map_core::grid_map_core + pluginlib::pluginlib + ${filters_TARGETS} + ${grid_map_msgs_TARGETS} + ${grid_map_ros_LIBRARIES} + ${TBB_LIBRARIES} + ) + + target_include_directories(${lib_name} SYSTEM PUBLIC + ${grid_map_ros_INCLUDE_DIRS} ) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") diff --git a/grid_map_loader/CMakeLists.txt b/grid_map_loader/CMakeLists.txt index d6407c6e2..1554a6650 100644 --- a/grid_map_loader/CMakeLists.txt +++ b/grid_map_loader/CMakeLists.txt @@ -36,16 +36,17 @@ add_library(${library_name} SHARED ) ## Specify libraries to link a library or executable target against -ament_target_dependencies(${PROJECT_NAME} SYSTEM - ${dependencies} +target_link_libraries(${library_name} PUBLIC + ${grid_map_msgs_TARGETS} + ${grid_map_ros_LIBRARIES} ) -target_link_libraries(${PROJECT_NAME} ${library_name}) - -ament_target_dependencies(${library_name} SYSTEM - ${dependencies} +target_include_directories(${library_name} SYSTEM PUBLIC + ${grid_map_ros_INCLUDE_DIRS} ) +target_link_libraries(${PROJECT_NAME} PRIVATE ${library_name}) + ############# ## Install ## ############# diff --git a/grid_map_octomap/CMakeLists.txt b/grid_map_octomap/CMakeLists.txt index bd060259e..77f5e43a2 100644 --- a/grid_map_octomap/CMakeLists.txt +++ b/grid_map_octomap/CMakeLists.txt @@ -24,8 +24,13 @@ add_library(${PROJECT_NAME} src/GridMapOctomapConverter.cpp ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM - ${dependencies} +target_link_libraries(${PROJECT_NAME} PUBLIC + grid_map_core::grid_map_core + ${OCTOMAP_LIBRARIES} +) + +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + ${OCTOMAP_INCLUDE_DIRS} ) ############# diff --git a/grid_map_pcl/CMakeLists.txt b/grid_map_pcl/CMakeLists.txt index 489f2adb9..c13d379ec 100644 --- a/grid_map_pcl/CMakeLists.txt +++ b/grid_map_pcl/CMakeLists.txt @@ -57,29 +57,30 @@ add_library(${PROJECT_NAME} SHARED ${SRC_FILES} ) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PUBLIC + grid_map_core::grid_map_core + rclcpp::rclcpp + rcutils::rcutils + ${grid_map_msgs_TARGETS} + ${grid_map_ros_LIBRARIES} ${OpenMP_CXX_LIBRARIES} ${PCL_LIBRARIES} yaml-cpp ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM - ${dependencies} +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + ${grid_map_ros_INCLUDE_DIRS} ) add_executable(grid_map_pcl_loader_node src/grid_map_pcl_loader_node.cpp ) -target_link_libraries(grid_map_pcl_loader_node +target_link_libraries(grid_map_pcl_loader_node PRIVATE ${PROJECT_NAME} ${OpenMP_CXX_LIBRARIES} ) -ament_target_dependencies(${PROJECT_NAME} - ${dependencies} -) - ############# ## Install ## ############# diff --git a/grid_map_rviz_plugin/CMakeLists.txt b/grid_map_rviz_plugin/CMakeLists.txt index 4425b60c3..63343a63c 100644 --- a/grid_map_rviz_plugin/CMakeLists.txt +++ b/grid_map_rviz_plugin/CMakeLists.txt @@ -54,8 +54,18 @@ add_library(${PROJECT_NAME} SHARED ${MOC_FILES} ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM - ${dependencies} +target_link_libraries(${PROJECT_NAME} PUBLIC + rclcpp::rclcpp + rviz_common::rviz_common + rviz_rendering::rviz_rendering + ${grid_map_msgs_TARGETS} + ${grid_map_ros_LIBRARIES} + ${rviz_ogre_vendor_LIBRARIES} +) + +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + ${grid_map_ros_INCLUDE_DIRS} + ${rviz_ogre_vendor_INCLUDE_DIRS} ) # Causes the visibility macros to use dllexport rather than dllimport, diff --git a/grid_map_sdf/CMakeLists.txt b/grid_map_sdf/CMakeLists.txt index 9294fb3e3..a38d1a6f3 100644 --- a/grid_map_sdf/CMakeLists.txt +++ b/grid_map_sdf/CMakeLists.txt @@ -42,8 +42,9 @@ add_library(${PROJECT_NAME} src/SignedDistanceField.cpp ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM - ${dependencies} +target_link_libraries(${PROJECT_NAME} PUBLIC + grid_map_core::grid_map_core + ${PCL_LIBRARIES} ) ############# diff --git a/grid_map_visualization/CMakeLists.txt b/grid_map_visualization/CMakeLists.txt index f46704c14..9e3bff1ef 100644 --- a/grid_map_visualization/CMakeLists.txt +++ b/grid_map_visualization/CMakeLists.txt @@ -52,8 +52,18 @@ add_library(${library_name} SHARED src/visualizations/VisualizationBase.cpp ) -ament_target_dependencies(${library_name} SYSTEM - ${dependencies} +target_link_libraries(${library_name} PUBLIC + grid_map_core::grid_map_core + rclcpp::rclcpp + ${grid_map_msgs_TARGETS} + ${grid_map_ros_LIBRARIES} + ${nav_msgs_TARGETS} + ${sensor_msgs_TARGETS} + ${visualization_msgs_TARGETS} +) + +target_include_directories(${library_name} SYSTEM PUBLIC + ${grid_map_ros_INCLUDE_DIRS} ) # Declare cpp node executable @@ -62,11 +72,7 @@ add_executable(${PROJECT_NAME} ) ## Specify libraries to link executable target against -target_link_libraries(${PROJECT_NAME} ${library_name}) - -ament_target_dependencies(${PROJECT_NAME} SYSTEM - ${dependencies} -) +target_link_libraries(${PROJECT_NAME} PRIVATE ${library_name}) ############# ## Install ## From d8e0ad33812828d366af3e19c2a801ecc589e932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 17:01:33 +0300 Subject: [PATCH 07/23] fix(grid_map_rviz_plugin): build with Qt 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RViz on Lyrical and Rolling uses Qt 6. With Qt 5, the moc output does not match the Qt headers. Find Qt 6 first and fall back to Qt 5, as rviz_common does, and use the versionless qt_wrap_cpp. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit f9f279090d8452abb40704d9c32817957eb4bce3) --- grid_map_rviz_plugin/CMakeLists.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/grid_map_rviz_plugin/CMakeLists.txt b/grid_map_rviz_plugin/CMakeLists.txt index 63343a63c..4535eecaa 100644 --- a/grid_map_rviz_plugin/CMakeLists.txt +++ b/grid_map_rviz_plugin/CMakeLists.txt @@ -5,7 +5,14 @@ find_package(ament_cmake REQUIRED) find_package(grid_map_cmake_helpers REQUIRED) find_package(grid_map_msgs REQUIRED) find_package(grid_map_ros REQUIRED) -find_package(Qt5 REQUIRED COMPONENTS Core Widgets) +# Avoid find_package(QT NAMES Qt6 Qt5 ...) due to CMake's default ascending path resolution +find_package(Qt6 QUIET COMPONENTS Core Widgets) +if(Qt6_FOUND) + set(QT_PACKAGE Qt6) +else() + find_package(Qt5 REQUIRED COMPONENTS Core Widgets) + set(QT_PACKAGE Qt5) +endif() find_package(rclcpp REQUIRED) find_package(rviz_common REQUIRED) find_package(rviz_ogre_vendor REQUIRED) @@ -34,7 +41,7 @@ set(INCLUDE_FILES_QT include/grid_map_rviz_plugin/GridMapDisplay.hpp ) -qt5_wrap_cpp(MOC_FILES ${INCLUDE_FILES_QT}) +qt_wrap_cpp(MOC_FILES ${INCLUDE_FILES_QT}) ## Avoid Qt signals and slots defining "emit", "slots", etc. add_definitions(-DQT_NO_KEYWORDS) @@ -143,7 +150,7 @@ endif() ament_export_include_directories(include) ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET) ament_export_dependencies( - Qt5 + ${QT_PACKAGE} rviz_common geometry_msgs nav_msgs From 1c3ad970b5d262d2cebe018eac435ad8b23ea7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 17:01:33 +0300 Subject: [PATCH 08/23] fix(grid_map_pcl): define JsonCpp::JsonCpp before finding PCL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Ubuntu 26.04, opencv_viz (through grid_map_ros) links VTK targets, and VTK::jsoncpp links JsonCpp::JsonCpp. VTK defines that target only when a caller asks for its jsoncpp component, and PCL does not. The CMake generate step then fails. find_package(jsoncpp) defines the target. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit 545f346632da5504504575d86de73735a730a235) --- grid_map_pcl/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grid_map_pcl/CMakeLists.txt b/grid_map_pcl/CMakeLists.txt index c13d379ec..cb0570f30 100644 --- a/grid_map_pcl/CMakeLists.txt +++ b/grid_map_pcl/CMakeLists.txt @@ -7,6 +7,9 @@ find_package(grid_map_cmake_helpers REQUIRED) find_package(grid_map_core REQUIRED) find_package(grid_map_msgs REQUIRED) find_package(grid_map_ros REQUIRED) +# VTK 9.5 on Ubuntu 26.04 links VTK::jsoncpp to JsonCpp::JsonCpp, but defines it only when a +# caller asks VTK for jsoncpp. opencv_viz from grid_map_ros pulls VTK::jsoncpp into the link. +find_package(jsoncpp QUIET) find_package(PCL REQUIRED) ## See ROS REP2000 for expected PCL version find_package(rclcpp REQUIRED) find_package(rcutils REQUIRED) From ce3f60abe7b6fef31f318030adde392638b47232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 17:01:33 +0300 Subject: [PATCH 09/23] fix: replace deprecated ROS 2 APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lyrical deprecates tf2_ros/transform_listener.h, rclcpp::spin_some and ament_index_cpp::get_package_share_directory. The packages build with -Werror, so each warning stops the build. Use tf2_ros/transform_listener.hpp, a SingleThreadedExecutor and get_package_share_path. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit 4dad1eed8124084117b3441b3d4db75b2e5c9403) --- grid_map_demos/src/octomap_to_gridmap_demo_node.cpp | 4 +++- grid_map_demos/src/tutorial_demo_node.cpp | 4 +++- grid_map_pcl/src/helpers.cpp | 6 +++--- grid_map_rviz_plugin/src/GridMapDisplay.cpp | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/grid_map_demos/src/octomap_to_gridmap_demo_node.cpp b/grid_map_demos/src/octomap_to_gridmap_demo_node.cpp index 594eedd07..6a22545f6 100644 --- a/grid_map_demos/src/octomap_to_gridmap_demo_node.cpp +++ b/grid_map_demos/src/octomap_to_gridmap_demo_node.cpp @@ -16,13 +16,15 @@ int main(int argc, char ** argv) rclcpp::init(argc, argv); auto octomapToGridmapDemo = std::make_shared(); + rclcpp::executors::SingleThreadedExecutor executor; + executor.add_node(octomapToGridmapDemo); rclcpp::sleep_for(std::chrono::seconds(2)); rclcpp::Rate r(0.1); // 1 hz while (rclcpp::ok()) { octomapToGridmapDemo->convertAndPublishMap(); - rclcpp::spin_some(octomapToGridmapDemo); + executor.spin_some(); r.sleep(); } return 0; diff --git a/grid_map_demos/src/tutorial_demo_node.cpp b/grid_map_demos/src/tutorial_demo_node.cpp index 35459f84f..14b96d293 100644 --- a/grid_map_demos/src/tutorial_demo_node.cpp +++ b/grid_map_demos/src/tutorial_demo_node.cpp @@ -12,6 +12,8 @@ int main(int argc, char ** argv) // Initialize node and publisher. rclcpp::init(argc, argv); rclcpp::Node::SharedPtr node = std::make_shared("grid_map_tutorial_demo"); + rclcpp::executors::SingleThreadedExecutor executor; + executor.add_node(node); auto publisher = node->create_publisher( "grid_map", rclcpp::QoS(1).transient_local()); @@ -108,7 +110,7 @@ int main(int argc, char ** argv) publisher->publish(std::move(message)); RCLCPP_INFO_THROTTLE(node->get_logger(), clock, 1000, "Grid map published."); - rclcpp::spin_some(node->get_node_base_interface()); + executor.spin_some(); rate.sleep(); } diff --git a/grid_map_pcl/src/helpers.cpp b/grid_map_pcl/src/helpers.cpp index ea840b59d..acc416fe0 100644 --- a/grid_map_pcl/src/helpers.cpp +++ b/grid_map_pcl/src/helpers.cpp @@ -6,7 +6,7 @@ * Institute: ETH Zurich, Robotic Systems Lab */ -#include +#include #include #include @@ -52,8 +52,8 @@ void setVerbosityLevelToDebugIfFlagSet(rclcpp::Node::SharedPtr & node) std::string getParameterPath() { - std::string filePath = ament_index_cpp::get_package_share_directory("grid_map_pcl") + - "/config/parameters.yaml"; + const auto sharePath = ament_index_cpp::get_package_share_path("grid_map_pcl"); + std::string filePath = (sharePath / "config" / "parameters.yaml").string(); return filePath; } diff --git a/grid_map_rviz_plugin/src/GridMapDisplay.cpp b/grid_map_rviz_plugin/src/GridMapDisplay.cpp index 4205d19d1..f42df5265 100644 --- a/grid_map_rviz_plugin/src/GridMapDisplay.cpp +++ b/grid_map_rviz_plugin/src/GridMapDisplay.cpp @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include From ae25aaa24f5ccbe2f86cd1fffce77bcbda074789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 17:01:33 +0300 Subject: [PATCH 10/23] fix(grid_map_demos): do not fail on the ciso646 warning from OctoMap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OctoMap 1.10.1 and older include , which emits a #warning in C++20. Ubuntu 26.04 ships OctoMap 1.10.0. Keep the warning, but do not make it an error for the one demo that includes OctoMap. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit d8c200f3af89e29af9d6b1ba14773ed0d3acdc2d) --- grid_map_demos/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grid_map_demos/CMakeLists.txt b/grid_map_demos/CMakeLists.txt index 362436b2f..997acae37 100644 --- a/grid_map_demos/CMakeLists.txt +++ b/grid_map_demos/CMakeLists.txt @@ -137,6 +137,9 @@ target_link_libraries(octomap_to_gridmap_demo PRIVATE ${octomap_msgs_TARGETS} ) +# OctoMap 1.10.1 and older include , which emits a #warning in C++20. +target_compile_options(octomap_to_gridmap_demo PRIVATE -Wno-error=cpp) + target_link_libraries(move_demo PRIVATE ${demo_libraries} ) From 2b22bdcabf5655ca5800f74e3fe78f83d0970d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 19:06:44 +0300 Subject: [PATCH 11/23] fix(grid_map_rviz_plugin): use the version-neutral Qt rosdep keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rviz_common, rviz_rendering and rviz_default_plugins declare Qt with qt-base-dev, libqtcore, libqtgui and libqtwidgets. Use the same keys, so that the plugin follows the Qt version of RViz. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit 52d14cbb9c8e9bce8fe42293daf2f0e108d5a149) --- grid_map_rviz_plugin/CMakeLists.txt | 2 +- grid_map_rviz_plugin/package.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/grid_map_rviz_plugin/CMakeLists.txt b/grid_map_rviz_plugin/CMakeLists.txt index 4535eecaa..ae570fb40 100644 --- a/grid_map_rviz_plugin/CMakeLists.txt +++ b/grid_map_rviz_plugin/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(rviz_rendering REQUIRED COMPONENTS Core Widgets) grid_map_package() -## Qt5 boilerplate options from http://doc.qt.io/qt-5/cmake-manual.html +## Qt boilerplate options set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) # This setting causes Qt's "MOC" generation to happen automatically. diff --git a/grid_map_rviz_plugin/package.xml b/grid_map_rviz_plugin/package.xml index ef76873f8..4d8447e24 100644 --- a/grid_map_rviz_plugin/package.xml +++ b/grid_map_rviz_plugin/package.xml @@ -14,7 +14,7 @@ ament_cmake grid_map_cmake_helpers - qtbase5-dev + qt-base-dev grid_map_msgs grid_map_ros @@ -23,9 +23,9 @@ rviz_ogre_vendor rviz_rendering - libqt5-core - libqt5-gui - libqt5-widgets + libqtcore + libqtgui + libqtwidgets ament_lint_auto ament_lint_common From 51d05ce15ecb6f26e803d362da3c6b7c24f6c6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 19:06:44 +0300 Subject: [PATCH 12/23] fix(grid_map_demos): limit -Wno-error=cpp to GCC and Clang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grid_map_package() adds -Werror only for GCC and Clang, so the exception follows the same condition. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit c27e840349a5a0f9ada159a81e4ae6c92328a441) --- grid_map_demos/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grid_map_demos/CMakeLists.txt b/grid_map_demos/CMakeLists.txt index 997acae37..779b1d3aa 100644 --- a/grid_map_demos/CMakeLists.txt +++ b/grid_map_demos/CMakeLists.txt @@ -138,7 +138,9 @@ target_link_libraries(octomap_to_gridmap_demo PRIVATE ) # OctoMap 1.10.1 and older include , which emits a #warning in C++20. -target_compile_options(octomap_to_gridmap_demo PRIVATE -Wno-error=cpp) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + target_compile_options(octomap_to_gridmap_demo PRIVATE -Wno-error=cpp) +endif() target_link_libraries(move_demo PRIVATE ${demo_libraries} From d73c982a712f276fa23d44375501df15f0307458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 17:01:47 +0300 Subject: [PATCH 13/23] test: replace deprecated ROS 2 headers and APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 5d0c4e8c951aea585c0a903702a514ac9a33f8fd) --- grid_map_costmap_2d/test/test_costmap_2d_ros.cpp | 4 ++-- grid_map_costmap_2d/test/test_costmap_2d_ros.hpp | 2 +- grid_map_pcl/test/test_helpers.cpp | 10 +++++----- grid_map_pcl/test/test_helpers.hpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp index 47ac158d0..bf0271328 100644 --- a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp +++ b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp @@ -11,8 +11,8 @@ #include "rclcpp/rclcpp.hpp" -#include "tf2_ros/transform_broadcaster.h" -#include "tf2/transform_datatypes.h" +#include "tf2_ros/transform_broadcaster.hpp" +#include "tf2/transform_datatypes.hpp" #include "test_costmap_2d_ros.hpp" diff --git a/grid_map_costmap_2d/test/test_costmap_2d_ros.hpp b/grid_map_costmap_2d/test/test_costmap_2d_ros.hpp index 86e58cbb9..ddd5093a1 100644 --- a/grid_map_costmap_2d/test/test_costmap_2d_ros.hpp +++ b/grid_map_costmap_2d/test/test_costmap_2d_ros.hpp @@ -15,7 +15,7 @@ #include "rclcpp/rclcpp.hpp" -#include "tf2_ros/transform_listener.h" +#include "tf2_ros/transform_listener.hpp" #include "geometry_msgs/msg/transform.hpp" #include "geometry_msgs/msg/vector3.hpp" #include "geometry_msgs/msg/quaternion.hpp" diff --git a/grid_map_pcl/test/test_helpers.cpp b/grid_map_pcl/test/test_helpers.cpp index 9ca5e9288..702119bf7 100644 --- a/grid_map_pcl/test/test_helpers.cpp +++ b/grid_map_pcl/test/test_helpers.cpp @@ -6,7 +6,7 @@ * Institute: ETH Zurich, Robotic Systems Lab */ -#include +#include #include #include @@ -29,8 +29,8 @@ std::string getConfigFilePath() std::string getTestDataFolderPath() { - std::string dir = ament_index_cpp::get_package_share_directory("grid_map_pcl") + - "/test_data"; + const auto sharePath = ament_index_cpp::get_package_share_path("grid_map_pcl"); + std::string dir = (sharePath / "test_data").string(); return dir; } @@ -195,8 +195,8 @@ Pointcloud::Ptr createStepTerrain( std::string getTestPcdFilePath() { - std::string filename = ament_index_cpp::get_package_share_directory("grid_map_pcl") + - "/test_data/plane_noisy.pcd"; + const auto sharePath = ament_index_cpp::get_package_share_path("grid_map_pcl"); + std::string filename = (sharePath / "test_data" / "plane_noisy.pcd").string(); return filename; } diff --git a/grid_map_pcl/test/test_helpers.hpp b/grid_map_pcl/test/test_helpers.hpp index 73bbc0195..0f48d9b53 100644 --- a/grid_map_pcl/test/test_helpers.hpp +++ b/grid_map_pcl/test/test_helpers.hpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include From 756c047d14344c0704dd00c6ac837be7858b8d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 17:01:47 +0300 Subject: [PATCH 14/23] test(grid_map_costmap_2d): follow the Nav2 costmap changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 07c87e04195461209e990b0e0504cb79969d0c73) --- .../test/test_costmap_2d_converter.cpp | 4 +-- .../test/test_costmap_2d_ros.cpp | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/grid_map_costmap_2d/test/test_costmap_2d_converter.cpp b/grid_map_costmap_2d/test/test_costmap_2d_converter.cpp index bf037b3d3..70e593d7c 100644 --- a/grid_map_costmap_2d/test/test_costmap_2d_converter.cpp +++ b/grid_map_costmap_2d/test/test_costmap_2d_converter.cpp @@ -40,9 +40,7 @@ class TestCostmap2DConversion const nav2_costmap_2d::Costmap2D & costMap) { // Check map info. - // Different conventions: Costmap2d returns the *centerpoint* of the last cell in the map. - grid_map::Length length = - gridMap.getLength() - grid_map::Length::Constant(0.5 * gridMap.getResolution()); + grid_map::Length length = gridMap.getLength(); grid_map::Length position = gridMap.getPosition() - 0.5 * gridMap.getLength().matrix(); EXPECT_EQ(costMap.getSizeInMetersX(), length.x()); EXPECT_EQ(costMap.getSizeInMetersY(), length.y()); diff --git a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp index bf0271328..3d31145dc 100644 --- a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp +++ b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp @@ -69,16 +69,22 @@ ROSCostmapServer::ROSCostmapServer( // - fires up an obstacle layer and an inflation layer // - creates a publisher for an occupancy grid - costmap_ = std::make_shared(name); - costmap_->set_parameter(rclcpp::Parameter{"plugins", std::vector()}); - costmap_->set_parameter(rclcpp::Parameter{"robot_base_frame", baseLinkTransformName}); - costmap_->set_parameter(rclcpp::Parameter{"origin_x", origin.x()}); - costmap_->set_parameter(rclcpp::Parameter{"origin_y", origin.y()}); - costmap_->set_parameter(rclcpp::Parameter{"width", width}); - costmap_->set_parameter(rclcpp::Parameter{"height", height}); - costmap_->set_parameter(rclcpp::Parameter{"resolution", 0.5}); - // clears 1 cell if inside, up to 4 cells on a vertex - costmap_->set_parameter(rclcpp::Parameter{"robot_radius", 0.03}); + // Costmap2DROS declares most parameters in on_configure(), so set them as overrides. + // Only the NodeOptions constructor keeps the overrides. + rclcpp::NodeOptions options; + options.arguments({"--ros-args", "-r", "__node:=" + name}); + options.parameter_overrides({ + {"plugins", std::vector()}, + {"robot_base_frame", baseLinkTransformName}, + {"origin_x", origin.x()}, + {"origin_y", origin.y()}, + {"width", width}, + {"height", height}, + {"resolution", 0.5}, + // clears 1 cell if inside, up to 4 cells on a vertex + {"robot_radius", 0.03}, + }); + costmap_ = std::make_shared(options); costmap_->configure(); costmap_->activate(); From bf93ae1f1685e397587503b9ea1889a8cb64f201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 19:06:56 +0300 Subject: [PATCH 15/23] test(grid_map_costmap_2d): keep each test costmap in its own namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 /, as the name constructor did. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit 4b237f055b1d3d2f5b3adbd3f9408c37d80d317e) --- grid_map_costmap_2d/test/test_costmap_2d_ros.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp index 3d31145dc..48332736e 100644 --- a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp +++ b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp @@ -72,7 +72,7 @@ ROSCostmapServer::ROSCostmapServer( // Costmap2DROS declares most parameters in on_configure(), so set them as overrides. // Only the NodeOptions constructor keeps the overrides. rclcpp::NodeOptions options; - options.arguments({"--ros-args", "-r", "__node:=" + name}); + options.arguments({"--ros-args", "-r", "__node:=" + name, "-r", "__ns:=/" + name}); options.parameter_overrides({ {"plugins", std::vector()}, {"robot_base_frame", baseLinkTransformName}, From 5ec78e50c10811ea185297bb78fb014b0776a84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 19:06:56 +0300 Subject: [PATCH 16/23] test: remove a stale comment and an unused include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 3e19669ad814e2337e4f25c915055c5af3a1e294) --- grid_map_costmap_2d/test/test_costmap_2d_ros.cpp | 6 ------ grid_map_pcl/test/test_helpers.hpp | 1 - 2 files changed, 7 deletions(-) diff --git a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp index 48332736e..7a2b13f5a 100644 --- a/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp +++ b/grid_map_costmap_2d/test/test_costmap_2d_ros.cpp @@ -63,12 +63,6 @@ ROSCostmapServer::ROSCostmapServer( : tfBuffer_(node_->get_clock()), tfListener_(tfBuffer_) { - // lots of parameters here affect the construction ( e.g. rolling window) - // if you don't have any parameters set, then this - // - alot of defaults which get dumped on the ros param server - // - fires up an obstacle layer and an inflation layer - // - creates a publisher for an occupancy grid - // Costmap2DROS declares most parameters in on_configure(), so set them as overrides. // Only the NodeOptions constructor keeps the overrides. rclcpp::NodeOptions options; diff --git a/grid_map_pcl/test/test_helpers.hpp b/grid_map_pcl/test/test_helpers.hpp index 0f48d9b53..a2258fc99 100644 --- a/grid_map_pcl/test/test_helpers.hpp +++ b/grid_map_pcl/test/test_helpers.hpp @@ -11,7 +11,6 @@ #include #include -#include #include #include #include From 7fe8fa97c4c63e83cc7c968f6382141bc60ff8f0 Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu Date: Sat, 14 Nov 2026 03:59:14 +0900 Subject: [PATCH 17/23] fix: take ConstSharedPtr in the subscription callbacks rclcpp deprecates subscription callbacks that take std::shared_ptr. Clang reports the deprecation through the template instantiation from create_subscription(), although the rclcpp headers are system headers, so grid_map_visualization and grid_map_demos do not build with -Werror. GCC does not report it. The three callbacks only read the message, so they can take std::shared_ptr. Co-Authored-By: Claude Opus 5.5 --- grid_map_demos/include/grid_map_demos/FiltersDemo.hpp | 2 +- grid_map_demos/include/grid_map_demos/ImageToGridmapDemo.hpp | 2 +- grid_map_demos/src/FiltersDemo.cpp | 2 +- grid_map_demos/src/ImageToGridmapDemo.cpp | 2 +- .../include/grid_map_visualization/GridMapVisualization.hpp | 2 +- grid_map_visualization/src/GridMapVisualization.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/grid_map_demos/include/grid_map_demos/FiltersDemo.hpp b/grid_map_demos/include/grid_map_demos/FiltersDemo.hpp index 50321beec..1831d4116 100644 --- a/grid_map_demos/include/grid_map_demos/FiltersDemo.hpp +++ b/grid_map_demos/include/grid_map_demos/FiltersDemo.hpp @@ -46,7 +46,7 @@ class FiltersDemo : public rclcpp::Node * Callback method for the incoming grid map message. * @param message the incoming message. */ - void callback(const grid_map_msgs::msg::GridMap::SharedPtr message); + void callback(const grid_map_msgs::msg::GridMap::ConstSharedPtr message); private: //! Name of the input grid map topic. diff --git a/grid_map_demos/include/grid_map_demos/ImageToGridmapDemo.hpp b/grid_map_demos/include/grid_map_demos/ImageToGridmapDemo.hpp index e5d0748ff..5bc842114 100644 --- a/grid_map_demos/include/grid_map_demos/ImageToGridmapDemo.hpp +++ b/grid_map_demos/include/grid_map_demos/ImageToGridmapDemo.hpp @@ -45,7 +45,7 @@ class ImageToGridmapDemo : public rclcpp::Node */ bool readParameters(); - void imageCallback(const sensor_msgs::msg::Image::SharedPtr msg); + void imageCallback(const sensor_msgs::msg::Image::ConstSharedPtr msg); private: //! Grid map publisher. diff --git a/grid_map_demos/src/FiltersDemo.cpp b/grid_map_demos/src/FiltersDemo.cpp index 58ebd627f..bc4d593b3 100644 --- a/grid_map_demos/src/FiltersDemo.cpp +++ b/grid_map_demos/src/FiltersDemo.cpp @@ -66,7 +66,7 @@ bool FiltersDemo::readParameters() return true; } -void FiltersDemo::callback(const grid_map_msgs::msg::GridMap::SharedPtr message) +void FiltersDemo::callback(const grid_map_msgs::msg::GridMap::ConstSharedPtr message) { // Convert message to map. grid_map::GridMap inputMap; diff --git a/grid_map_demos/src/ImageToGridmapDemo.cpp b/grid_map_demos/src/ImageToGridmapDemo.cpp index a0dcb35ee..cbb39f210 100644 --- a/grid_map_demos/src/ImageToGridmapDemo.cpp +++ b/grid_map_demos/src/ImageToGridmapDemo.cpp @@ -48,7 +48,7 @@ bool ImageToGridmapDemo::readParameters() return true; } -void ImageToGridmapDemo::imageCallback(const sensor_msgs::msg::Image::SharedPtr msg) +void ImageToGridmapDemo::imageCallback(const sensor_msgs::msg::Image::ConstSharedPtr msg) { if (!mapInitialized_) { grid_map::GridMapRosConverter::initializeFromImage(*msg, resolution_, map_); diff --git a/grid_map_visualization/include/grid_map_visualization/GridMapVisualization.hpp b/grid_map_visualization/include/grid_map_visualization/GridMapVisualization.hpp index 674c7ba91..f0e297e3a 100644 --- a/grid_map_visualization/include/grid_map_visualization/GridMapVisualization.hpp +++ b/grid_map_visualization/include/grid_map_visualization/GridMapVisualization.hpp @@ -49,7 +49,7 @@ class GridMapVisualization * Callback function for the grid map. * @param message the grid map message to be visualized. */ - void callback(const grid_map_msgs::msg::GridMap::SharedPtr message); + void callback(const grid_map_msgs::msg::GridMap::ConstSharedPtr message); //! ROS node shared pointer rclcpp::Node::SharedPtr nodePtr; diff --git a/grid_map_visualization/src/GridMapVisualization.cpp b/grid_map_visualization/src/GridMapVisualization.cpp index 91a57f65b..269bf7992 100644 --- a/grid_map_visualization/src/GridMapVisualization.cpp +++ b/grid_map_visualization/src/GridMapVisualization.cpp @@ -160,7 +160,7 @@ void GridMapVisualization::updateSubscriptionCallback() } } -void GridMapVisualization::callback(const grid_map_msgs::msg::GridMap::SharedPtr message) +void GridMapVisualization::callback(const grid_map_msgs::msg::GridMap::ConstSharedPtr message) { RCLCPP_DEBUG( nodePtr->get_logger(), From a4f1047b8626615445a69d163909d6de72233b6b Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu Date: Sat, 14 Nov 2026 03:59:14 +0900 Subject: [PATCH 18/23] test(grid_map_core): remove unused variables in SubmapIteratorTest The tests declare two Eigen::Array2i variables that they never use. With Eigen 5, Clang reports them with -Wunused-variable, and the test does not build with -Werror. Co-Authored-By: Claude Opus 5.5 --- grid_map_core/test/SubmapIteratorTest.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/grid_map_core/test/SubmapIteratorTest.cpp b/grid_map_core/test/SubmapIteratorTest.cpp index bfa594df8..b328f8856 100644 --- a/grid_map_core/test/SubmapIteratorTest.cpp +++ b/grid_map_core/test/SubmapIteratorTest.cpp @@ -28,8 +28,6 @@ TEST(SubmapIterator, Simple) { Eigen::Array2i submapTopLeftIndex(3, 1); Eigen::Array2i submapBufferSize(3, 2); - Eigen::Array2i index; - Eigen::Array2i submapIndex; std::vector types; types.push_back("type"); @@ -91,8 +89,6 @@ TEST(SubmapIterator, CircularBuffer) { Eigen::Array2i submapTopLeftIndex(6, 3); Eigen::Array2i submapBufferSize(2, 4); - Eigen::Array2i index; - Eigen::Array2i submapIndex; std::vector types; types.push_back("type"); From a963b50a80a34c27770cdf1f01206ea1f8fa8452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 16:49:08 +0300 Subject: [PATCH 19/23] ci: build and test on Lyrical and Rolling with Ubuntu 26.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mete Fatih Cırıt (cherry picked from commit 97f8be77608949b58a51ad4c33a116dbacb2bfd3) --- .github/workflows/colcon.yaml | 18 ++++++++++++------ .github/workflows/industrial-ci.yaml | 6 ++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/colcon.yaml b/.github/workflows/colcon.yaml index 3ec2d796c..e80bb8cff 100644 --- a/.github/workflows/colcon.yaml +++ b/.github/workflows/colcon.yaml @@ -16,13 +16,19 @@ jobs: fail-fast: false matrix: config: - - {rosdistro: 'rolling', container: 'rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-desktop-latest'} - container: - image: ${{ matrix.config.container }} + - {rosdistro: 'lyrical', ros_repo: 'main', skip_keys: ''} + # octomap_rviz_plugins has no Rolling binary on Ubuntu 26.04 yet. + - {rosdistro: 'rolling', ros_repo: 'testing', skip_keys: 'octomap_rviz_plugins'} + container: + image: ros:${{ matrix.config.rosdistro }}-ros-base-resolute steps: - uses: actions/checkout@v4 with: path: src/grid_map + - name: Use the ROS testing repository + run: sed -i 's|packages.ros.org/ros2/ubuntu|packages.ros.org/ros2-testing/ubuntu|' /etc/apt/sources.list.d/* + shell: bash + if: ${{ matrix.config.ros_repo == 'testing' }} - name: Pull in repos with vcs run: | apt-get update @@ -32,10 +38,10 @@ jobs: if: ${{ matrix.config.rosdistro == 'rolling' }} - name: Install Dependencies with Rosdep run: | - apt update - rosdep update + apt-get update + rosdep update --rosdistro ${{matrix.config.rosdistro}} source /opt/ros/${{matrix.config.rosdistro}}/setup.bash - rosdep install --from-paths src --ignore-src -y --skip-keys "slam_toolbox" + rosdep install --from-paths $(colcon list --packages-up-to grid_map --paths-only) --ignore-src -y --rosdistro ${{matrix.config.rosdistro}} --skip-keys "${{matrix.config.skip_keys}}" shell: bash - name: Colcon Build (Release) run: | diff --git a/.github/workflows/industrial-ci.yaml b/.github/workflows/industrial-ci.yaml index 9dcea912f..12b082c2e 100644 --- a/.github/workflows/industrial-ci.yaml +++ b/.github/workflows/industrial-ci.yaml @@ -18,10 +18,12 @@ on: jobs: industrial_ci: strategy: + fail-fast: false matrix: env: + - {ROS_DISTRO: lyrical, ROS_REPO: main} + - {ROS_DISTRO: lyrical, ROS_REPO: testing} - {ROS_DISTRO: rolling, ROS_REPO: testing} - - {ROS_DISTRO: rolling, ROS_REPO: main} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -34,6 +36,6 @@ jobs: # It also is out of date, so grid_map is just going to skip keys we are sure don't work. - name: set ROSDEP_SKIP_KEYS to skip nav2 keys if: ${{ matrix.env.ROS_DISTRO == 'rolling' }} - run: echo "ROSDEP_SKIP_KEYS=slam_toolbox" >> $GITHUB_ENV + run: echo "ROSDEP_SKIP_KEYS=slam_toolbox octomap_rviz_plugins" >> $GITHUB_ENV - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}} From ae8970c821497568d04c0b1546316aaa63cad3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 16:55:11 +0300 Subject: [PATCH 20/23] ci: skip octomap_server on Rolling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mete Fatih Cırıt (cherry picked from commit 15f134b9a34261a34e8d82f7d6880d5c26424872) --- .github/workflows/colcon.yaml | 4 ++-- .github/workflows/industrial-ci.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/colcon.yaml b/.github/workflows/colcon.yaml index e80bb8cff..484fd47ec 100644 --- a/.github/workflows/colcon.yaml +++ b/.github/workflows/colcon.yaml @@ -17,8 +17,8 @@ jobs: matrix: config: - {rosdistro: 'lyrical', ros_repo: 'main', skip_keys: ''} - # octomap_rviz_plugins has no Rolling binary on Ubuntu 26.04 yet. - - {rosdistro: 'rolling', ros_repo: 'testing', skip_keys: 'octomap_rviz_plugins'} + # octomap_rviz_plugins and octomap_server have no Rolling binary on Ubuntu 26.04 yet. + - {rosdistro: 'rolling', ros_repo: 'testing', skip_keys: 'octomap_rviz_plugins octomap_server'} container: image: ros:${{ matrix.config.rosdistro }}-ros-base-resolute steps: diff --git a/.github/workflows/industrial-ci.yaml b/.github/workflows/industrial-ci.yaml index 12b082c2e..d1f5c3344 100644 --- a/.github/workflows/industrial-ci.yaml +++ b/.github/workflows/industrial-ci.yaml @@ -36,6 +36,6 @@ jobs: # It also is out of date, so grid_map is just going to skip keys we are sure don't work. - name: set ROSDEP_SKIP_KEYS to skip nav2 keys if: ${{ matrix.env.ROS_DISTRO == 'rolling' }} - run: echo "ROSDEP_SKIP_KEYS=slam_toolbox octomap_rviz_plugins" >> $GITHUB_ENV + run: echo "ROSDEP_SKIP_KEYS=slam_toolbox octomap_rviz_plugins octomap_server" >> $GITHUB_ENV - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}} From 959b9ac330acada2df51d9635280e6b99d9977e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 19:07:15 +0300 Subject: [PATCH 21/23] ci: upgrade the image packages after switching to ros2-testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The image comes with ROS packages from the main repository. Without an upgrade, rosdep installs packages from ros2-testing next to older ones from the image. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit 158f281672c27243378c78233b4cad69d3b1995a) --- .github/workflows/colcon.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/colcon.yaml b/.github/workflows/colcon.yaml index 484fd47ec..3a4bd0573 100644 --- a/.github/workflows/colcon.yaml +++ b/.github/workflows/colcon.yaml @@ -26,7 +26,10 @@ jobs: with: path: src/grid_map - name: Use the ROS testing repository - run: sed -i 's|packages.ros.org/ros2/ubuntu|packages.ros.org/ros2-testing/ubuntu|' /etc/apt/sources.list.d/* + run: | + sed -i 's|packages.ros.org/ros2/ubuntu|packages.ros.org/ros2-testing/ubuntu|' /etc/apt/sources.list.d/* + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade shell: bash if: ${{ matrix.config.ros_repo == 'testing' }} - name: Pull in repos with vcs From ba8d5e4123496dd01c3e679eb2f3c0e33476e63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 19:07:15 +0300 Subject: [PATCH 22/23] ci: cancel superseded runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new push to the same branch or pull request cancels the older run. The Rolling legs build Nav2 from source and take up to one hour. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit e1c0cb63575c927c85827356391e980d592968db) --- .github/workflows/colcon.yaml | 4 ++++ .github/workflows/industrial-ci.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/colcon.yaml b/.github/workflows/colcon.yaml index 3a4bd0573..2389278e6 100644 --- a/.github/workflows/colcon.yaml +++ b/.github/workflows/colcon.yaml @@ -9,6 +9,10 @@ on: pull_request: branches: - '*' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-test: runs-on: ubuntu-latest diff --git a/.github/workflows/industrial-ci.yaml b/.github/workflows/industrial-ci.yaml index d1f5c3344..8de2b7299 100644 --- a/.github/workflows/industrial-ci.yaml +++ b/.github/workflows/industrial-ci.yaml @@ -15,6 +15,10 @@ on: branches: - '*' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: industrial_ci: strategy: From 14e6a7f0ff47294b08c8424416f23463ea9937c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mete=20Fatih=20C=C4=B1r=C4=B1t?= Date: Fri, 13 Nov 2026 19:07:15 +0300 Subject: [PATCH 23/23] ci: give the build jobs fixed names and explain the skipped keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The skip keys no longer appear in the check name. The industrial_ci step now also names the two octomap keys, which belong to grid_map_demos, not to Nav2. Signed-off-by: Mete Fatih Cırıt (cherry picked from commit e3bc7a9236813e535839f001e1ace62cbf2110ed) --- .github/workflows/colcon.yaml | 1 + .github/workflows/industrial-ci.yaml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/colcon.yaml b/.github/workflows/colcon.yaml index 2389278e6..0c7743280 100644 --- a/.github/workflows/colcon.yaml +++ b/.github/workflows/colcon.yaml @@ -15,6 +15,7 @@ concurrency: jobs: build-test: + name: build-test (${{ matrix.config.rosdistro }}, ${{ matrix.config.ros_repo }}) runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/industrial-ci.yaml b/.github/workflows/industrial-ci.yaml index 8de2b7299..a7c0f727c 100644 --- a/.github/workflows/industrial-ci.yaml +++ b/.github/workflows/industrial-ci.yaml @@ -38,7 +38,8 @@ jobs: # We duplicate NAV2's key skipping because I doubt they intend this bespoke file to be used by other CI jobs: # https://github.com/ros-navigation/navigation2/blob/main/tools/skip_keys.txt # It also is out of date, so grid_map is just going to skip keys we are sure don't work. - - name: set ROSDEP_SKIP_KEYS to skip nav2 keys + # octomap_rviz_plugins and octomap_server have no Rolling binary on Ubuntu 26.04 yet. + - name: Set ROSDEP_SKIP_KEYS to skip keys without Rolling binaries if: ${{ matrix.env.ROS_DISTRO == 'rolling' }} run: echo "ROSDEP_SKIP_KEYS=slam_toolbox octomap_rviz_plugins octomap_server" >> $GITHUB_ENV - uses: 'ros-industrial/industrial_ci@master'