From 56ad25e7dbf9ab5f82b3d02d3484d574e59193d1 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sat, 1 Aug 2026 18:21:39 +0200 Subject: [PATCH 01/10] Add RTAB-Map --- vinca.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/vinca.yaml b/vinca.yaml index 44ca52d..9f3f9dd 100644 --- a/vinca.yaml +++ b/vinca.yaml @@ -174,6 +174,7 @@ packages_select_by_deps: - camera_ros # Depends on libcamera that is only available on linux - livox_ros_driver2 - py_binding_tools + - rtabmap - swri_serial_util # Serial communication only implemented for linux - v4l2_camera # Depends on v4l that is only available on linux From 9b9d23f4863ce7ef72ff0b73c44f337d9eeaee43 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sat, 1 Aug 2026 18:35:13 +0200 Subject: [PATCH 02/10] Disable Qt5-only g2o in RTAB-Map --- patch/dependencies.yaml | 2 ++ pkg_additional_info.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/patch/dependencies.yaml b/patch/dependencies.yaml index d712cde..5e09dd8 100644 --- a/patch/dependencies.yaml +++ b/patch/dependencies.yaml @@ -88,6 +88,8 @@ popf: add_host: ["perl"] rtabmap: add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "libdc1394", "libusb", "vtk"] + remove_host: ["ros-lyrical-libg2o"] + remove_run: ["ros-lyrical-libg2o"] backward_ros: add_host: ["${{ 'binutils' if linux }}", "${{ 'elfutils' if linux }}", "ros-lyrical-ament-cmake-libraries"] nav2_smac_planner: diff --git a/pkg_additional_info.yaml b/pkg_additional_info.yaml index 3c110ba..9bfe55f 100644 --- a/pkg_additional_info.yaml +++ b/pkg_additional_info.yaml @@ -133,6 +133,8 @@ pybind11_vendor: additional_cmake_args: "-DAMENT_VENDOR_POLICY=NEVER_VENDOR" robot_state_publisher: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +rtabmap: + additional_cmake_args: "-DWITH_G2O=OFF" rosx_introspection: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rviz_ogre_vendor: From 37367462776fe9728765231abdd5096f61eb8b03 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sat, 1 Aug 2026 18:39:24 +0200 Subject: [PATCH 03/10] Disable incompatible GTSAM support in RTAB-Map --- patch/dependencies.yaml | 4 ++-- pkg_additional_info.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/patch/dependencies.yaml b/patch/dependencies.yaml index 5e09dd8..0aca861 100644 --- a/patch/dependencies.yaml +++ b/patch/dependencies.yaml @@ -88,8 +88,8 @@ popf: add_host: ["perl"] rtabmap: add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "libdc1394", "libusb", "vtk"] - remove_host: ["ros-lyrical-libg2o"] - remove_run: ["ros-lyrical-libg2o"] + remove_host: ["ros-lyrical-gtsam", "ros-lyrical-libg2o"] + remove_run: ["ros-lyrical-gtsam", "ros-lyrical-libg2o"] backward_ros: add_host: ["${{ 'binutils' if linux }}", "${{ 'elfutils' if linux }}", "ros-lyrical-ament-cmake-libraries"] nav2_smac_planner: diff --git a/pkg_additional_info.yaml b/pkg_additional_info.yaml index 9bfe55f..f20ab91 100644 --- a/pkg_additional_info.yaml +++ b/pkg_additional_info.yaml @@ -134,7 +134,7 @@ pybind11_vendor: robot_state_publisher: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rtabmap: - additional_cmake_args: "-DWITH_G2O=OFF" + additional_cmake_args: "-DWITH_G2O=OFF -DWITH_GTSAM=OFF" rosx_introspection: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rviz_ogre_vendor: From e64e744684121cb54a00d9d5e962c8d5f04f3ccc Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sat, 1 Aug 2026 20:04:28 +0200 Subject: [PATCH 04/10] Keep RTAB-Map g2o and GTSAM optimizers --- patch/dependencies.yaml | 4 ---- patch/ros-lyrical-rtabmap.patch | 18 ++++++++++++++++++ pkg_additional_info.yaml | 4 ++-- 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 patch/ros-lyrical-rtabmap.patch diff --git a/patch/dependencies.yaml b/patch/dependencies.yaml index 0aca861..591796b 100644 --- a/patch/dependencies.yaml +++ b/patch/dependencies.yaml @@ -73,8 +73,6 @@ tvm_vendor: add_host: ["libblas", "openblas", "libcblas"] libphidget22: add_host: ["libusb"] -libg2o: - add_host: ["qt", "libglu", "freeglut"] fmilibrary_vendor: add_host: ["fmilib"] mrpt2: @@ -88,8 +86,6 @@ popf: add_host: ["perl"] rtabmap: add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "libdc1394", "libusb", "vtk"] - remove_host: ["ros-lyrical-gtsam", "ros-lyrical-libg2o"] - remove_run: ["ros-lyrical-gtsam", "ros-lyrical-libg2o"] backward_ros: add_host: ["${{ 'binutils' if linux }}", "${{ 'elfutils' if linux }}", "ros-lyrical-ament-cmake-libraries"] nav2_smac_planner: diff --git a/patch/ros-lyrical-rtabmap.patch b/patch/ros-lyrical-rtabmap.patch new file mode 100644 index 0000000..93ddd11 --- /dev/null +++ b/patch/ros-lyrical-rtabmap.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b7d36de..44e1164 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -530,8 +530,12 @@ IF(WITH_G2O) + ENDIF(WITH_G2O) + + IF(WITH_GTSAM) +- # Force config mode to ignore PCL's findGTSAM.cmake file ++ # GTSAM's config searches for Eigen. Prefer Eigen's config so RTAB-Map's ++ # legacy FindEigen3 module does not try to parse Eigen 5 headers. ++ SET(_RTABMAP_CMAKE_FIND_PACKAGE_PREFER_CONFIG ${CMAKE_FIND_PACKAGE_PREFER_CONFIG}) ++ SET(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) + FIND_PACKAGE(GTSAM CONFIG QUIET) ++ SET(CMAKE_FIND_PACKAGE_PREFER_CONFIG ${_RTABMAP_CMAKE_FIND_PACKAGE_PREFER_CONFIG}) + ENDIF(WITH_GTSAM) + + IF(WITH_MRPT) diff --git a/pkg_additional_info.yaml b/pkg_additional_info.yaml index f20ab91..f1c7d94 100644 --- a/pkg_additional_info.yaml +++ b/pkg_additional_info.yaml @@ -133,8 +133,8 @@ pybind11_vendor: additional_cmake_args: "-DAMENT_VENDOR_POLICY=NEVER_VENDOR" robot_state_publisher: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" -rtabmap: - additional_cmake_args: "-DWITH_G2O=OFF -DWITH_GTSAM=OFF" +libg2o: + additional_cmake_args: "-DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF" rosx_introspection: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rviz_ogre_vendor: From 6869c885df589ee31f711b231415cd7b70014099 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sun, 2 Aug 2026 00:22:40 +0200 Subject: [PATCH 05/10] Try RTAB-Map on all platforms --- vinca.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vinca.yaml b/vinca.yaml index 9f3f9dd..cdabe32 100644 --- a/vinca.yaml +++ b/vinca.yaml @@ -126,6 +126,7 @@ packages_select_by_deps: - rmw_zenoh_cpp # requested in https://github.com/RoboStack/ros-humble/issues/252 - robot - robot-localization + - rtabmap - ros2_control - ros2_controllers - ros2_fmt_logger @@ -174,7 +175,6 @@ packages_select_by_deps: - camera_ros # Depends on libcamera that is only available on linux - livox_ros_driver2 - py_binding_tools - - rtabmap - swri_serial_util # Serial communication only implemented for linux - v4l2_camera # Depends on v4l that is only available on linux From 31d51674a1f840a4c3392e367ba75a356768c9ec Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sun, 2 Aug 2026 00:31:40 +0200 Subject: [PATCH 06/10] Fix RTAB-Map dependencies on macOS and Windows --- patch/dependencies.yaml | 2 +- pkg_additional_info.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patch/dependencies.yaml b/patch/dependencies.yaml index 591796b..9ee8729 100644 --- a/patch/dependencies.yaml +++ b/patch/dependencies.yaml @@ -85,7 +85,7 @@ ros1_rosbag_storage_vendor: popf: add_host: ["perl"] rtabmap: - add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "libdc1394", "libusb", "vtk"] + add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "libboost-devel", "libdc1394", "libusb", "vtk"] backward_ros: add_host: ["${{ 'binutils' if linux }}", "${{ 'elfutils' if linux }}", "ros-lyrical-ament-cmake-libraries"] nav2_smac_planner: diff --git a/pkg_additional_info.yaml b/pkg_additional_info.yaml index f1c7d94..886bd8a 100644 --- a/pkg_additional_info.yaml +++ b/pkg_additional_info.yaml @@ -134,7 +134,7 @@ pybind11_vendor: robot_state_publisher: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" libg2o: - additional_cmake_args: "-DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF" + additional_cmake_args: "-DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF -DBUILD_LGPL_SHARED_LIBS=ON" rosx_introspection: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rviz_ogre_vendor: From f1d48a9ce8d563a64be6a5b47e336720728421ef Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sun, 2 Aug 2026 21:38:50 +0200 Subject: [PATCH 07/10] Fix RTAB-Map for Boost 1.90 and Windows --- patch/dependencies.yaml | 2 +- patch/ros-lyrical-rtabmap.patch | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/patch/dependencies.yaml b/patch/dependencies.yaml index 9ee8729..46032df 100644 --- a/patch/dependencies.yaml +++ b/patch/dependencies.yaml @@ -85,7 +85,7 @@ ros1_rosbag_storage_vendor: popf: add_host: ["perl"] rtabmap: - add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "libboost-devel", "libdc1394", "libusb", "vtk"] + add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "libboost-devel", "${{ 'libdc1394' if not win }}", "libusb", "vtk"] backward_ros: add_host: ["${{ 'binutils' if linux }}", "${{ 'elfutils' if linux }}", "ros-lyrical-ament-cmake-libraries"] nav2_smac_planner: diff --git a/patch/ros-lyrical-rtabmap.patch b/patch/ros-lyrical-rtabmap.patch index 93ddd11..4b03a13 100644 --- a/patch/ros-lyrical-rtabmap.patch +++ b/patch/ros-lyrical-rtabmap.patch @@ -16,3 +16,13 @@ index b7d36de..44e1164 100644 ENDIF(WITH_GTSAM) IF(WITH_MRPT) +@@ -578,7 +582,7 @@ ENDIF(WITH_POINTMATCHER) + IF(libpointmatcher_FOUND OR GTSAM_FOUND) +- find_package(Boost COMPONENTS thread filesystem system program_options date_time REQUIRED) ++ find_package(Boost COMPONENTS thread filesystem program_options date_time REQUIRED) + IF(Boost_MINOR_VERSION GREATER 47) +- find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono timer serialization REQUIRED) ++ find_package(Boost COMPONENTS thread filesystem program_options date_time chrono timer serialization REQUIRED) + ENDIF(Boost_MINOR_VERSION GREATER 47) + IF(WIN32) + MESSAGE(STATUS "Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}") From 481de581d51667bdea088e664fc7b49e4fe185e9 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sun, 2 Aug 2026 22:04:50 +0200 Subject: [PATCH 08/10] Coalesce duplicate TBB template symbols on Windows --- patch/ros-lyrical-rtabmap.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/patch/ros-lyrical-rtabmap.patch b/patch/ros-lyrical-rtabmap.patch index 4b03a13..48bb2d6 100644 --- a/patch/ros-lyrical-rtabmap.patch +++ b/patch/ros-lyrical-rtabmap.patch @@ -26,3 +26,14 @@ index b7d36de..44e1164 100644 ENDIF(Boost_MINOR_VERSION GREATER 47) IF(WIN32) MESSAGE(STATUS "Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}") +diff --git a/corelib/src/CMakeLists.txt b/corelib/src/CMakeLists.txt +index b758ad0..3f29cba 100644 +--- a/corelib/src/CMakeLists.txt ++++ b/corelib/src/CMakeLists.txt +@@ -855,0 +856,6 @@ ADD_LIBRARY(rtabmap::core ALIAS rtabmap_core) ++# GTSAM and this target both instantiate an identical inline TBB allocator ++# vector accessor on MSVC. Let the linker coalesce that duplicate definition. ++IF(MSVC) ++ TARGET_LINK_OPTIONS(rtabmap_core PRIVATE "/FORCE:MULTIPLE") ++ENDIF(MSVC) ++ From 60090543ba5ff973de6f22e7c4ebf1f9a0734180 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sun, 2 Aug 2026 23:06:07 +0200 Subject: [PATCH 09/10] Expose Windows COM declarations to RTAB-Map apps --- patch/ros-lyrical-rtabmap.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/patch/ros-lyrical-rtabmap.patch b/patch/ros-lyrical-rtabmap.patch index 48bb2d6..72dae88 100644 --- a/patch/ros-lyrical-rtabmap.patch +++ b/patch/ros-lyrical-rtabmap.patch @@ -26,6 +26,16 @@ index b7d36de..44e1164 100644 ENDIF(Boost_MINOR_VERSION GREATER 47) IF(WIN32) MESSAGE(STATUS "Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}") +@@ -112,5 +116,8 @@ if(MSVC) + endif() + endif() + add_compile_options("/bigobj") ++ # CoInitialize() is used by Windows GUI entry points without including the ++ # COM declaration header explicitly. ++ add_compile_options("/FIobjbase.h") + endif() + + # Detect CPU arch and whether we are in 32 or 64 bit diff --git a/corelib/src/CMakeLists.txt b/corelib/src/CMakeLists.txt index b758ad0..3f29cba 100644 --- a/corelib/src/CMakeLists.txt From a9835c7c32b8b0c3a81a6c5b2921dc70203ab133 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Mon, 3 Aug 2026 11:39:06 +0200 Subject: [PATCH 10/10] Include Winsock before forced Windows COM headers --- patch/ros-lyrical-rtabmap.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patch/ros-lyrical-rtabmap.patch b/patch/ros-lyrical-rtabmap.patch index 72dae88..e73249f 100644 --- a/patch/ros-lyrical-rtabmap.patch +++ b/patch/ros-lyrical-rtabmap.patch @@ -26,12 +26,13 @@ index b7d36de..44e1164 100644 ENDIF(Boost_MINOR_VERSION GREATER 47) IF(WIN32) MESSAGE(STATUS "Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}") -@@ -112,5 +116,8 @@ if(MSVC) +@@ -112,5 +116,9 @@ if(MSVC) endif() endif() add_compile_options("/bigobj") -+ # CoInitialize() is used by Windows GUI entry points without including the -+ # COM declaration header explicitly. ++ # GUI entry points use CoInitialize(). Force the COM declarations while ++ # ensuring the modern Winsock header precedes windows.h in every source. ++ add_compile_options("/FIwinsock2.h") + add_compile_options("/FIobjbase.h") endif()