From 5652edc7b9a2e42a57d1b6c643763b66cf9a6649 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Mon, 19 Oct 2026 09:18:17 +1000 Subject: [PATCH 01/17] Add rtabmap_ros (not on Windows) [skip ci] Ports RoboStack/ros-lyrical#83, refreshed for 0.23.13 (all of humble, jazzy and lyrical after their syncs; rolling has no rtabmap_ros release): the aarch64 find_library probes stay optional (upstream made them optional for rtabmap_msgs/rtabmap_sync/rtabmap_viz, the other four still need it), OpenCV 5 headers and constants, and rtabmap_viz's macOS OpenGL context fix. Co-authored-by: Kamil Baradziej <49471097+baradejoo@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- shared/patch/ros2-rtabmap-conversions.patch | 30 ++++++++++++++++++++ shared/patch/ros2-rtabmap-odom.patch | 14 +++++++++ shared/patch/ros2-rtabmap-rviz-plugins.patch | 14 +++++++++ shared/patch/ros2-rtabmap-slam.patch | 27 ++++++++++++++++++ shared/patch/ros2-rtabmap-viz.patch | 30 ++++++++++++++++++++ shared/vinca.yaml | 1 + 6 files changed, 116 insertions(+) create mode 100644 shared/patch/ros2-rtabmap-conversions.patch create mode 100644 shared/patch/ros2-rtabmap-odom.patch create mode 100644 shared/patch/ros2-rtabmap-rviz-plugins.patch create mode 100644 shared/patch/ros2-rtabmap-slam.patch create mode 100644 shared/patch/ros2-rtabmap-viz.patch diff --git a/shared/patch/ros2-rtabmap-conversions.patch b/shared/patch/ros2-rtabmap-conversions.patch new file mode 100644 index 000000000..ed9d61a03 --- /dev/null +++ b/shared/patch/ros2-rtabmap-conversions.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4dc4190..ed08e21 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,8 +9,7 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + # issues #1285 #1288 + find_library( + builtin_interfaces__rosidl_generator_c_LIB NAMES builtin_interfaces__rosidl_generator_c +- PATHS "/opt/ros/$ENV{ROS_DISTRO}/lib" +- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH REQUIRED ++ REQUIRED + ) + endif() + +diff --git a/include/rtabmap_conversions/MsgConversion.h b/include/rtabmap_conversions/MsgConversion.h +index 4e82e38..6f657f3 100644 +--- a/include/rtabmap_conversions/MsgConversion.h ++++ b/include/rtabmap_conversions/MsgConversion.h +@@ -39,7 +39,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include + + #include ++#if CV_MAJOR_VERSION < 5 + #include ++#else ++#include ++#endif + #ifdef PRE_ROS_IRON + #include + #else diff --git a/shared/patch/ros2-rtabmap-odom.patch b/shared/patch/ros2-rtabmap-odom.patch new file mode 100644 index 000000000..787c9e906 --- /dev/null +++ b/shared/patch/ros2-rtabmap-odom.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7b10ad2..6ef5020 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,8 +14,7 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + # issues #1285 #1288 + find_library( + builtin_interfaces__rosidl_generator_c_LIB NAMES builtin_interfaces__rosidl_generator_c +- PATHS "/opt/ros/$ENV{ROS_DISTRO}/lib" +- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH REQUIRED ++ REQUIRED + ) + endif() + diff --git a/shared/patch/ros2-rtabmap-rviz-plugins.patch b/shared/patch/ros2-rtabmap-rviz-plugins.patch new file mode 100644 index 000000000..69e452c31 --- /dev/null +++ b/shared/patch/ros2-rtabmap-rviz-plugins.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4e47a68..c8eb361 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,8 +9,7 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + # issues #1285 #1288 + find_library( + message_filters_LIB NAMES message_filters +- PATHS "/opt/ros/$ENV{ROS_DISTRO}/lib" +- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH REQUIRED ++ REQUIRED + ) + endif() + diff --git a/shared/patch/ros2-rtabmap-slam.patch b/shared/patch/ros2-rtabmap-slam.patch new file mode 100644 index 000000000..24b821e90 --- /dev/null +++ b/shared/patch/ros2-rtabmap-slam.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6107b23..97ea89f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,8 +14,7 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + # issues #1285 #1288 + find_library( + builtin_interfaces__rosidl_generator_c_LIB NAMES builtin_interfaces__rosidl_generator_c +- PATHS "/opt/ros/$ENV{ROS_DISTRO}/lib" +- NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH REQUIRED ++ REQUIRED + ) + endif() + +diff --git a/src/CoreWrapper.cpp b/src/CoreWrapper.cpp +index c1fb75b..bb732d6 100644 +--- a/src/CoreWrapper.cpp ++++ b/src/CoreWrapper.cpp +@@ -1474,7 +1474,7 @@ void CoreWrapper::commonMultiCameraCallbackImpl( + cv::Mat leftMono; + if(rgb.channels() == 3) + { +- cv::cvtColor(rgb, leftMono, CV_BGR2GRAY); ++ cv::cvtColor(rgb, leftMono, cv::COLOR_BGR2GRAY); + } + else + { diff --git a/shared/patch/ros2-rtabmap-viz.patch b/shared/patch/ros2-rtabmap-viz.patch new file mode 100644 index 000000000..b5c695de7 --- /dev/null +++ b/shared/patch/ros2-rtabmap-viz.patch @@ -0,0 +1,30 @@ +diff --git a/src/GuiNode.cpp b/src/GuiNode.cpp +index 88895ed..e62af21 100644 +--- a/src/GuiNode.cpp ++++ b/src/GuiNode.cpp +@@ -32,6 +32,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include + #include + #include ++#include ++#include ++#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1) ++#include ++#endif + + QApplication * app = 0; + +@@ -49,6 +54,13 @@ int main(int argc, char** argv) + + rclcpp::init(argc, argv); + ++#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1) ++ // needed to ensure appropriate OpenGL context is created for VTK rendering ++ // (without it, macOS creates a legacy OpenGL 2.1 context and VTK crashes). ++ QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat()); ++#endif ++ QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); ++ + app = new QApplication(argc, argv); + app->connect( app, SIGNAL( lastWindowClosed() ), app, SLOT( quit() ) ); + diff --git a/shared/vinca.yaml b/shared/vinca.yaml index c93bc0853..354088045 100644 --- a/shared/vinca.yaml +++ b/shared/vinca.yaml @@ -581,6 +581,7 @@ packages_select_by_deps: - rqt_reconfigure - rqt_tf_tree - rslidar_sdk # rs_driver's Windows socket code has multiple pre-existing min/max-macro and getsockopt/setsockopt type bugs; not pursuing further + - rtabmap_ros # Windows not tried yet; requested in https://github.com/RoboStack/ros-lyrical/pull/83 - rviz_2d_overlay_plugins - rviz_satellite - smacc2 From c8024d9d467df826f0aecca254836bdecebd6140 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Mon, 19 Oct 2026 11:54:43 +1000 Subject: [PATCH 02/17] humble: rtabmap with its Qt GUI, as in jazzy [skip ci] humble's rtabmap was configured with WITH_QT=OFF (and GTSAM off on Windows) when it was at 0.22.1, to avoid porting the GUI to OpenCV 5. After the sync it's 0.23.13 like jazzy, with the same patch, and rtabmap_viz needs the gui component, so use jazzy's settings. rtabmap needs a rebuild for humble. Co-Authored-By: Claude Opus 5.5 --- distros/humble/pkg_additional_info.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/distros/humble/pkg_additional_info.yaml b/distros/humble/pkg_additional_info.yaml index 4a9f1f592..5add4721f 100644 --- a/distros/humble/pkg_additional_info.yaml +++ b/distros/humble/pkg_additional_info.yaml @@ -87,10 +87,9 @@ py_trees: max_pin: 'x.x.x' override_version: '2.5.0' rtabmap: - additional_cmake_args: - if: win - then: "-DWITH_QT=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DWITH_GTSAM=OFF" - else: "-DWITH_QT=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF" + # 0.23.13 as in jazzy: with its Qt GUI (rtabmap_viz needs it) and GTSAM; its tests + # (corelib/test) don't build with MSVC + additional_cmake_args: -DBUILD_TESTING=OFF urdfdom: generate_dummy_package_with_run_deps: dep_name: urdfdom From 4415fca3c90b0f9fbaca91d9615bd1345d37d6f6 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Mon, 19 Oct 2026 12:02:14 +1000 Subject: [PATCH 03/17] humble: keep rtabmap without Qt, exclude rtabmap_viz [skip ci] Reverts the previous commit: rtabmap takes its Qt version from VTK, which is Qt 6 on conda-forge, while humble's RViz is Qt 5, so rtabmap with its GUI breaks rtabmap_rviz_plugins (Qt5 and Qt6 targets in one target). Keep humble's rtabmap without Qt as before and exclude rtabmap_viz, the package that needs the GUI. Co-Authored-By: Claude Opus 5.5 --- distros/humble/pkg_additional_info.yaml | 7 ++++--- distros/humble/vinca.yaml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/distros/humble/pkg_additional_info.yaml b/distros/humble/pkg_additional_info.yaml index 5add4721f..4a9f1f592 100644 --- a/distros/humble/pkg_additional_info.yaml +++ b/distros/humble/pkg_additional_info.yaml @@ -87,9 +87,10 @@ py_trees: max_pin: 'x.x.x' override_version: '2.5.0' rtabmap: - # 0.23.13 as in jazzy: with its Qt GUI (rtabmap_viz needs it) and GTSAM; its tests - # (corelib/test) don't build with MSVC - additional_cmake_args: -DBUILD_TESTING=OFF + additional_cmake_args: + if: win + then: "-DWITH_QT=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DWITH_GTSAM=OFF" + else: "-DWITH_QT=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF" urdfdom: generate_dummy_package_with_run_deps: dep_name: urdfdom diff --git a/distros/humble/vinca.yaml b/distros/humble/vinca.yaml index 6ddebe7c5..321afca11 100644 --- a/distros/humble/vinca.yaml +++ b/distros/humble/vinca.yaml @@ -12,6 +12,7 @@ mutex_package: version: "0.10.0" packages_exclude: + - rtabmap_viz # needs rtabmap's GUI, which follows VTK's Qt 6, while humble's RViz is Qt 5 (rtabmap is built without Qt here) - if: not linux then: From c92864ec6ebd9c520eff79eeda83c2bc6b1303fc Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Mon, 19 Oct 2026 12:05:59 +1000 Subject: [PATCH 04/17] humble: exclude rtabmap_rviz_plugins [skip ci] It links PCL, whose VTK is built against Qt 6 on conda-forge, into a Qt 5 RViz plugin: "INTERFACE_QT_MAJOR_VERSION of Qt6::OpenGL does not agree with QT_MAJOR_VERSION" (tried locally, with rtabmap built without Qt). Co-Authored-By: Claude Opus 5.5 --- distros/humble/vinca.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/distros/humble/vinca.yaml b/distros/humble/vinca.yaml index 321afca11..1283b4941 100644 --- a/distros/humble/vinca.yaml +++ b/distros/humble/vinca.yaml @@ -12,6 +12,7 @@ mutex_package: version: "0.10.0" packages_exclude: + - rtabmap_rviz_plugins # links PCL, whose VTK is Qt 6 on conda-forge, into a Qt 5 RViz plugin (humble's RViz is Qt 5) - rtabmap_viz # needs rtabmap's GUI, which follows VTK's Qt 6, while humble's RViz is Qt 5 (rtabmap is built without Qt here) - if: not linux From 749435013a4fe5510ce98e8bd9a80d42080d59f3 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Mon, 19 Oct 2026 12:28:02 +1000 Subject: [PATCH 05/17] humble: rtabmap_util doesn't need rtabmap's gui component [skip ci] rtabmap_util asks for find_package(RTABMap COMPONENTS gui), but none of its sources use the GUI, and humble's rtabmap is built without Qt (see the exclusions of rtabmap_viz and rtabmap_rviz_plugins). Co-Authored-By: Claude Opus 5.5 --- distros/humble/patch/ros2-rtabmap-util.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 distros/humble/patch/ros2-rtabmap-util.patch diff --git a/distros/humble/patch/ros2-rtabmap-util.patch b/distros/humble/patch/ros2-rtabmap-util.patch new file mode 100644 index 000000000..d295dbbd6 --- /dev/null +++ b/distros/humble/patch/ros2-rtabmap-util.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9104af7..b0c0be8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,7 +28,8 @@ find_package(rtabmap_msgs REQUIRED) + find_package(rtabmap_conversions REQUIRED) + find_package(rtabmap_sync REQUIRED) + +-find_package(RTABMap COMPONENTS gui REQUIRED) ++# nothing here uses rtabmap's GUI, and humble's rtabmap is built without Qt ++find_package(RTABMap REQUIRED) + + # Optional components + find_package(octomap_msgs) From 86072ad06bb77a8efbd18e7651b0c2b97892499c Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Mon, 19 Oct 2026 16:53:56 +1000 Subject: [PATCH 06/17] jazzy: exclude rtabmap_rviz_plugins (Qt 5 RViz, Qt 6 VTK) [skip ci] As on humble: the plugin links PCL, whose VTK is Qt 6 on conda-forge, into jazzy's Qt 5 RViz, and CMake refuses the mix (INTERFACE_QT_MAJOR_VERSION of Qt6::OpenGL). Unlike humble, jazzy's rtabmap_viz builds and links only Qt 6 (rtabmap's own), so it stays. Found by a linux-64 build on top of the jazzy sync. Co-Authored-By: Claude Opus 5.5 --- distros/jazzy/vinca.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distros/jazzy/vinca.yaml b/distros/jazzy/vinca.yaml index 2488b5a77..6a91a4389 100644 --- a/distros/jazzy/vinca.yaml +++ b/distros/jazzy/vinca.yaml @@ -12,3 +12,6 @@ mutex_package: # new build without run_constraints (same version as the published ones) build_number: 26 version: "0.19.0" + +packages_exclude: + - rtabmap_rviz_plugins # links PCL, whose VTK is Qt 6 on conda-forge, into a Qt 5 RViz plugin (jazzy's RViz is Qt 5); rtabmap_viz is fine, it uses only rtabmap's Qt 6 From 7bfc9878ad882e9a19d0f9df68f2b3d37a75568e Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Mon, 19 Oct 2026 18:33:15 +1000 Subject: [PATCH 07/17] rtabmap_slam: recipe test that the rtabmap node starts [skip ci] Turns the local checks of this PR into a recipe test, so later rebuilds keep them. Co-Authored-By: Claude Opus 5.5 --- shared/tests/ros2-rtabmap-slam.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 shared/tests/ros2-rtabmap-slam.yaml diff --git a/shared/tests/ros2-rtabmap-slam.yaml b/shared/tests/ros2-rtabmap-slam.yaml new file mode 100644 index 000000000..3ee7169ac --- /dev/null +++ b/shared/tests/ros2-rtabmap-slam.yaml @@ -0,0 +1,6 @@ +tests: + # Smoke test: `rtabmap_slam/rtabmap` (the SLAM node) starts (loads its libraries and the RMW) and is still running after 5 s. + - if: unix + then: + script: + - python -c "import os, subprocess, sys, time; p = subprocess.Popen([os.path.join(os.environ['PREFIX'], 'lib', 'rtabmap_slam', 'rtabmap')]); time.sleep(5); r = p.poll(); p.terminate(); sys.exit(0 if r is None else 1)" From c1a69f1f6ad2861179694f24792d73bcbd33a987 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 07:28:09 +1000 Subject: [PATCH 08/17] rtabmap_ros: build on Windows too Export all symbols of the rtabmap_ros libraries on Windows (their visibility headers are unused, nothing is dllexported otherwise). Recipe test on Windows: the rtabmap executable is installed. Co-Authored-By: Claude Opus 5.5 --- shared/pkg_additional_info.yaml | 12 ++++++++++++ shared/tests/ros2-rtabmap-slam.yaml | 4 ++++ shared/vinca.yaml | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/shared/pkg_additional_info.yaml b/shared/pkg_additional_info.yaml index 4db4b4fd2..c30fac196 100644 --- a/shared/pkg_additional_info.yaml +++ b/shared/pkg_additional_info.yaml @@ -134,6 +134,18 @@ robot_state_publisher: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rosx_introspection: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +rtabmap_conversions: + additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +rtabmap_odom: + additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +rtabmap_slam: + additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +rtabmap_sync: + additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +rtabmap_util: + additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +rtabmap_viz: + additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" sbg_driver: additional_cmake_args: if: win diff --git a/shared/tests/ros2-rtabmap-slam.yaml b/shared/tests/ros2-rtabmap-slam.yaml index 3ee7169ac..cf14c69c3 100644 --- a/shared/tests/ros2-rtabmap-slam.yaml +++ b/shared/tests/ros2-rtabmap-slam.yaml @@ -4,3 +4,7 @@ tests: then: script: - python -c "import os, subprocess, sys, time; p = subprocess.Popen([os.path.join(os.environ['PREFIX'], 'lib', 'rtabmap_slam', 'rtabmap')]); time.sleep(5); r = p.poll(); p.terminate(); sys.exit(0 if r is None else 1)" + - if: win + then: + script: + - if not exist %LIBRARY_LIB%\rtabmap_slam\rtabmap.exe exit 1 diff --git a/shared/vinca.yaml b/shared/vinca.yaml index eadc12d62..2724ae47f 100644 --- a/shared/vinca.yaml +++ b/shared/vinca.yaml @@ -322,6 +322,7 @@ packages_select_by_deps: - rqt_robot_steering - rqt_runtime_monitor - rtabmap + - rtabmap_ros # requested in https://github.com/RoboStack/ros-lyrical/pull/83 - rtcm_msgs - rtest - rviz2 @@ -572,7 +573,6 @@ packages_select_by_deps: - rqt_reconfigure - rqt_tf_tree - rslidar_sdk # rs_driver's Windows socket code has multiple pre-existing min/max-macro and getsockopt/setsockopt type bugs; not pursuing further - - rtabmap_ros # Windows not tried yet; requested in https://github.com/RoboStack/ros-lyrical/pull/83 - rviz_2d_overlay_plugins - rviz_satellite - smacc2 From 75cd897220ed9309fe752660f2979e03df1905e6 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 07:31:54 +1000 Subject: [PATCH 09/17] jazzy vinca.yaml: keep the sorter's layout Co-Authored-By: Claude Opus 5.5 --- distros/jazzy/vinca.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/distros/jazzy/vinca.yaml b/distros/jazzy/vinca.yaml index cb3b175dd..b04914ded 100644 --- a/distros/jazzy/vinca.yaml +++ b/distros/jazzy/vinca.yaml @@ -15,3 +15,4 @@ mutex_package: packages_exclude: - rtabmap_rviz_plugins # links PCL, whose VTK is Qt 6 on conda-forge, into a Qt 5 RViz plugin (jazzy's RViz is Qt 5); rtabmap_viz is fine, it uses only rtabmap's Qt 6 + From 8ccec3b1ec065a91eddc9d902530f83e88abe056 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 07:41:28 +1000 Subject: [PATCH 10/17] rtabmap_costmap_plugins, rtabmap_rviz_plugins: define the macro their visibility headers check They define RTABMAP_ROS_BUILDING_LIBRARY, but visibility.h only dllexports with RTABMAP__BUILDING_DLL, so on Windows the plugin class was dllimport inside its own DLL (LNK2019 on the constructor). Co-Authored-By: Claude Opus 5.5 --- shared/patch/ros2-rtabmap-costmap-plugins.patch | 13 +++++++++++++ shared/patch/ros2-rtabmap-rviz-plugins.patch | 11 ++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 shared/patch/ros2-rtabmap-costmap-plugins.patch diff --git a/shared/patch/ros2-rtabmap-costmap-plugins.patch b/shared/patch/ros2-rtabmap-costmap-plugins.patch new file mode 100644 index 000000000..d568415f5 --- /dev/null +++ b/shared/patch/ros2-rtabmap-costmap-plugins.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index eab748d..233a90d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -55,7 +55,7 @@ ENDIF() + + # Causes the visibility macros to use dllexport rather than dllimport, + # which is appropriate when building the dll but not consuming it. +-target_compile_definitions(rtabmap_costmap_plugins PRIVATE "RTABMAP_ROS_BUILDING_LIBRARY") ++target_compile_definitions(rtabmap_costmap_plugins PRIVATE "RTABMAP_COSTMAP_PLUGINS_BUILDING_DLL") + + # prevent pluginlib from using boost + target_compile_definitions(rtabmap_costmap_plugins PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") diff --git a/shared/patch/ros2-rtabmap-rviz-plugins.patch b/shared/patch/ros2-rtabmap-rviz-plugins.patch index 69e452c31..a0810fc04 100644 --- a/shared/patch/ros2-rtabmap-rviz-plugins.patch +++ b/shared/patch/ros2-rtabmap-rviz-plugins.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4e47a68..c8eb361 100644 +index 4e47a68..4658ddb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,7 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") @@ -12,3 +12,12 @@ index 4e47a68..c8eb361 100644 ) endif() +@@ -96,7 +95,7 @@ ENDIF() + + # Causes the visibility macros to use dllexport rather than dllimport, + # which is appropriate when building the dll but not consuming it. +-target_compile_definitions(rtabmap_rviz_plugins PRIVATE "RTABMAP_ROS_BUILDING_LIBRARY") ++target_compile_definitions(rtabmap_rviz_plugins PRIVATE "RTABMAP_RVIZ_PLUGINS_BUILDING_DLL") + + # prevent pluginlib from using boost + target_compile_definitions(rtabmap_rviz_plugins PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") From 63596e0a7551351edd586af1060ad61ec14a1bfe Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 08:14:57 +1000 Subject: [PATCH 11/17] rtabmap_sync: export CommonDataSubscriber explicitly on Windows Exporting every symbol of rtabmap_sync exceeds the 65535-object limit of an import library (LNK1189): dllexport CommonDataSubscriber via its visibility macro instead, and export all of rtabmap_sync_plugins only. rtabmap_viz has no library, so it needs no exports. Co-Authored-By: Claude Opus 5.5 --- shared/patch/ros2-rtabmap-sync.win.patch | 30 ++++++++++++++++++++++++ shared/pkg_additional_info.yaml | 4 ---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 shared/patch/ros2-rtabmap-sync.win.patch diff --git a/shared/patch/ros2-rtabmap-sync.win.patch b/shared/patch/ros2-rtabmap-sync.win.patch new file mode 100644 index 000000000..bea5fb3a1 --- /dev/null +++ b/shared/patch/ros2-rtabmap-sync.win.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5e1b4da..fc0f9e7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -146,6 +146,12 @@ ELSE() + ENDIF() + target_link_libraries(rtabmap_sync_plugins PUBLIC rtabmap_sync) + ++# Windows: export CommonDataSubscriber explicitly (exporting every symbol of ++# rtabmap_sync exceeds the 65535 limit of an import library, LNK1189), and ++# everything of the plugins, whose node classes the executables construct. ++target_compile_definitions(rtabmap_sync PRIVATE RTABMAP_SYNC_BUILDING_DLL) ++set_target_properties(rtabmap_sync_plugins PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) ++ + rclcpp_components_register_nodes(rtabmap_sync_plugins "rtabmap_sync::RGBDSync") + rclcpp_components_register_nodes(rtabmap_sync_plugins "rtabmap_sync::StereoSync") + rclcpp_components_register_nodes(rtabmap_sync_plugins "rtabmap_sync::RGBSync") +diff --git a/include/rtabmap_sync/CommonDataSubscriber.h b/include/rtabmap_sync/CommonDataSubscriber.h +index 1282a4c..bd06345 100644 +--- a/include/rtabmap_sync/CommonDataSubscriber.h ++++ b/include/rtabmap_sync/CommonDataSubscriber.h +@@ -130,7 +130,7 @@ namespace rtabmap_sync { + * publishes -- which needs no rebuild and has no camera-count limit, at the cost of one + * extra node and one full-frame copy per camera. + */ +-class CommonDataSubscriber { ++class RTABMAP_SYNC_PUBLIC CommonDataSubscriber { + public: + /** + * @brief Declares the `subscribe_*`, queue and QoS parameters on @p node. diff --git a/shared/pkg_additional_info.yaml b/shared/pkg_additional_info.yaml index c30fac196..819c18452 100644 --- a/shared/pkg_additional_info.yaml +++ b/shared/pkg_additional_info.yaml @@ -140,12 +140,8 @@ rtabmap_odom: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rtabmap_slam: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" -rtabmap_sync: - additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rtabmap_util: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" -rtabmap_viz: - additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" sbg_driver: additional_cmake_args: if: win From 4a6e26d017f8c3dea0b3c2bc9d4105b91aad906d Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 08:22:11 +1000 Subject: [PATCH 12/17] rtabmap_sync: export the class, not also its constructor (C2487) Co-Authored-By: Claude Opus 5.5 --- shared/patch/ros2-rtabmap-sync.win.patch | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shared/patch/ros2-rtabmap-sync.win.patch b/shared/patch/ros2-rtabmap-sync.win.patch index bea5fb3a1..c05693311 100644 --- a/shared/patch/ros2-rtabmap-sync.win.patch +++ b/shared/patch/ros2-rtabmap-sync.win.patch @@ -16,7 +16,7 @@ index 5e1b4da..fc0f9e7 100644 rclcpp_components_register_nodes(rtabmap_sync_plugins "rtabmap_sync::StereoSync") rclcpp_components_register_nodes(rtabmap_sync_plugins "rtabmap_sync::RGBSync") diff --git a/include/rtabmap_sync/CommonDataSubscriber.h b/include/rtabmap_sync/CommonDataSubscriber.h -index 1282a4c..bd06345 100644 +index 1282a4c..ff46ecd 100644 --- a/include/rtabmap_sync/CommonDataSubscriber.h +++ b/include/rtabmap_sync/CommonDataSubscriber.h @@ -130,7 +130,7 @@ namespace rtabmap_sync { @@ -28,3 +28,11 @@ index 1282a4c..bd06345 100644 public: /** * @brief Declares the `subscribe_*`, queue and QoS parameters on @p node. +@@ -142,7 +142,6 @@ public: + * @param gui true for a visualization node: `subscribe_depth` and `subscribe_rgb` + * then default to false, leaving odometry as the only default input + */ +- RTABMAP_SYNC_PUBLIC + CommonDataSubscriber(rclcpp::Node & node, bool gui); + virtual ~CommonDataSubscriber(); + From 45556298c080ddecbc50c05e32e18b148df7974a Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 08:47:25 +1000 Subject: [PATCH 13/17] rtabmap_util, rtabmap_odom, rtabmap_slam, rtabmap_viz: Windows link path and NOMINMAX rtabmap::core links some PCL libraries by bare name (pcl_visualization, pcl_keypoints; RTABMapConfig.cmake defines no imported target for them), so LINK could not find them (LNK1181): add %LIBRARY_LIB% to the link path. NOMINMAX for Eigen's Parallelizer next to windows.h (C2589), and std::array::data() instead of begin() for memcpy in db_player (C2664). The Windows-only cmake args no longer touch the other platforms. humble needs its own copy of the .win.patch next to its ros2-rtabmap-util.patch. Co-Authored-By: Claude Opus 5.5 --- .../humble/patch/ros2-rtabmap-util.win.patch | 13 +++++++++++++ shared/patch/ros2-rtabmap-util.win.patch | 13 +++++++++++++ shared/pkg_additional_info.yaml | 19 ++++++++++++++++--- 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 distros/humble/patch/ros2-rtabmap-util.win.patch create mode 100644 shared/patch/ros2-rtabmap-util.win.patch diff --git a/distros/humble/patch/ros2-rtabmap-util.win.patch b/distros/humble/patch/ros2-rtabmap-util.win.patch new file mode 100644 index 000000000..4e9b27e90 --- /dev/null +++ b/distros/humble/patch/ros2-rtabmap-util.win.patch @@ -0,0 +1,13 @@ +diff --git a/src/nodelets/db_player.cpp b/src/nodelets/db_player.cpp +index cacd679..e906d61 100644 +--- a/src/nodelets/db_player.cpp ++++ b/src/nodelets/db_player.cpp +@@ -543,7 +543,7 @@ bool DbPlayer::publishNextFrame() + UASSERT(odomMsg.pose.covariance.size() == 36 && + odom.covariance().total() == 36 && + odom.covariance().type() == CV_64FC1); +- memcpy(odomMsg.pose.covariance.begin(), odom.covariance().data, 36*sizeof(double)); ++ memcpy(odomMsg.pose.covariance.data(), odom.covariance().data, 36*sizeof(double)); + odometryPub_->publish(odomMsg); + } + diff --git a/shared/patch/ros2-rtabmap-util.win.patch b/shared/patch/ros2-rtabmap-util.win.patch new file mode 100644 index 000000000..4e9b27e90 --- /dev/null +++ b/shared/patch/ros2-rtabmap-util.win.patch @@ -0,0 +1,13 @@ +diff --git a/src/nodelets/db_player.cpp b/src/nodelets/db_player.cpp +index cacd679..e906d61 100644 +--- a/src/nodelets/db_player.cpp ++++ b/src/nodelets/db_player.cpp +@@ -543,7 +543,7 @@ bool DbPlayer::publishNextFrame() + UASSERT(odomMsg.pose.covariance.size() == 36 && + odom.covariance().total() == 36 && + odom.covariance().type() == CV_64FC1); +- memcpy(odomMsg.pose.covariance.begin(), odom.covariance().data, 36*sizeof(double)); ++ memcpy(odomMsg.pose.covariance.data(), odom.covariance().data, 36*sizeof(double)); + odometryPub_->publish(odomMsg); + } + diff --git a/shared/pkg_additional_info.yaml b/shared/pkg_additional_info.yaml index 819c18452..26165f476 100644 --- a/shared/pkg_additional_info.yaml +++ b/shared/pkg_additional_info.yaml @@ -136,12 +136,25 @@ rosx_introspection: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" rtabmap_conversions: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +# rtabmap_odom/slam/util/viz on Windows: rtabmap::core links some PCL libraries by bare +# name (pcl_visualization, pcl_keypoints; RTABMapConfig.cmake creates no imported target +# for them), so add the library directory to the link path; NOMINMAX for Eigen vs windows.h. rtabmap_odom: - additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" + additional_cmake_args: + if: win + then: '-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_CXX_FLAGS_INIT=/DNOMINMAX -DCMAKE_SHARED_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB% -DCMAKE_EXE_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB%' rtabmap_slam: - additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" + additional_cmake_args: + if: win + then: '-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_CXX_FLAGS_INIT=/DNOMINMAX -DCMAKE_SHARED_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB% -DCMAKE_EXE_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB%' rtabmap_util: - additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" + additional_cmake_args: + if: win + then: '-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_CXX_FLAGS_INIT=/DNOMINMAX -DCMAKE_SHARED_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB% -DCMAKE_EXE_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB%' +rtabmap_viz: + additional_cmake_args: + if: win + then: '-DCMAKE_CXX_FLAGS_INIT=/DNOMINMAX -DCMAKE_SHARED_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB% -DCMAKE_EXE_LINKER_FLAGS_INIT=/LIBPATH:%LIBRARY_LIB%' sbg_driver: additional_cmake_args: if: win From aeef9a06d7a36b34c15a5394d21b415fee26945d Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 09:11:41 +1000 Subject: [PATCH 14/17] rtabmap_odom, rtabmap_slam: undefine windows.h's ERROR before DiagnosticStatus::ERROR Co-Authored-By: Claude Opus 5.5 --- shared/patch/ros2-rtabmap-odom.win.patch | 16 ++++++++++++++++ shared/patch/ros2-rtabmap-slam.win.patch | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 shared/patch/ros2-rtabmap-odom.win.patch create mode 100644 shared/patch/ros2-rtabmap-slam.win.patch diff --git a/shared/patch/ros2-rtabmap-odom.win.patch b/shared/patch/ros2-rtabmap-odom.win.patch new file mode 100644 index 000000000..6aeab2611 --- /dev/null +++ b/shared/patch/ros2-rtabmap-odom.win.patch @@ -0,0 +1,16 @@ +diff --git a/src/OdometryROS.cpp b/src/OdometryROS.cpp +index 6a44b86..f0b5ba5 100644 +--- a/src/OdometryROS.cpp ++++ b/src/OdometryROS.cpp +@@ -56,6 +56,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "rtabmap/utilite/UFile.h" + #include "rtabmap/utilite/UMath.h" + ++// windows.h (wingdi.h) defines ERROR, which breaks diagnostic_msgs' DiagnosticStatus::ERROR ++#ifdef ERROR ++#undef ERROR ++#endif ++ + #define BAD_COVARIANCE 9999 + + using namespace rtabmap; diff --git a/shared/patch/ros2-rtabmap-slam.win.patch b/shared/patch/ros2-rtabmap-slam.win.patch new file mode 100644 index 000000000..c690abb44 --- /dev/null +++ b/shared/patch/ros2-rtabmap-slam.win.patch @@ -0,0 +1,16 @@ +diff --git a/src/CoreWrapper.cpp b/src/CoreWrapper.cpp +index 7321ccc..912832d 100644 +--- a/src/CoreWrapper.cpp ++++ b/src/CoreWrapper.cpp +@@ -90,6 +90,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + #include "rtabmap_conversions/MsgConversion.h" + ++// windows.h (wingdi.h) defines ERROR, which breaks diagnostic_msgs' DiagnosticStatus::ERROR ++#ifdef ERROR ++#undef ERROR ++#endif ++ + #ifdef PRE_ROS_JAZZY + namespace rclcpp { + rmw_qos_profile_t ServicesQoS() {return rmw_qos_profile_services_default;} From 1579cffb58de293d9d3d78a816e1ee4c251de5e2 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 09:30:27 +1000 Subject: [PATCH 15/17] rtabmap_viz: signal() instead of sigaction on Windows; velodyne_laserscan: _USE_MATH_DEFINES on Windows velodyne_laserscan comes in on Windows through rtabmap_examples. Co-Authored-By: Claude Opus 5.5 --- shared/patch/ros2-rtabmap-viz.win.patch | 42 +++++++++++++++++++++++++ shared/pkg_additional_info.yaml | 4 +++ 2 files changed, 46 insertions(+) create mode 100644 shared/patch/ros2-rtabmap-viz.win.patch diff --git a/shared/patch/ros2-rtabmap-viz.win.patch b/shared/patch/ros2-rtabmap-viz.win.patch new file mode 100644 index 000000000..cad98ff87 --- /dev/null +++ b/shared/patch/ros2-rtabmap-viz.win.patch @@ -0,0 +1,42 @@ +diff --git a/src/GuiNode.cpp b/src/GuiNode.cpp +index e62af21..2ee0cea 100644 +--- a/src/GuiNode.cpp ++++ b/src/GuiNode.cpp +@@ -78,11 +78,16 @@ int main(int argc, char** argv) + + // Catch ctrl-c to close the gui + // (Place this after QApplication's constructor) ++#ifdef _WIN32 ++ // no sigaction on Windows ++ signal(SIGINT, my_handler); ++#else + struct sigaction sigIntHandler; + sigIntHandler.sa_handler = my_handler; + sigemptyset(&sigIntHandler.sa_mask); + sigIntHandler.sa_flags = 0; + sigaction(SIGINT, &sigIntHandler, NULL); ++#endif + + // Here start the ROS events loop + rclcpp::executors::SingleThreadedExecutor executor; //Use 1 thread +diff --git a/src/RGBDImageViewerNode.cpp b/src/RGBDImageViewerNode.cpp +index f277ac8..7a0326d 100644 +--- a/src/RGBDImageViewerNode.cpp ++++ b/src/RGBDImageViewerNode.cpp +@@ -55,11 +55,16 @@ int main(int argc, char** argv) + + // Catch ctrl-c to close the gui + // (Place this after QApplication's constructor) ++#ifdef _WIN32 ++ // no sigaction on Windows ++ signal(SIGINT, my_handler); ++#else + struct sigaction sigIntHandler; + sigIntHandler.sa_handler = my_handler; + sigemptyset(&sigIntHandler.sa_mask); + sigIntHandler.sa_flags = 0; + sigaction(SIGINT, &sigIntHandler, NULL); ++#endif + + // Here start the ROS events loop + rclcpp::executors::SingleThreadedExecutor executor; //Use 1 thread diff --git a/shared/pkg_additional_info.yaml b/shared/pkg_additional_info.yaml index 26165f476..0714bb355 100644 --- a/shared/pkg_additional_info.yaml +++ b/shared/pkg_additional_info.yaml @@ -179,6 +179,10 @@ urdfdom_py: generate_dummy_package_with_run_deps: dep_name: urdfdom-py max_pin: 'x.x' +velodyne_laserscan: # M_PI on Windows (pulled in by rtabmap_examples) + additional_cmake_args: + if: win + then: '-DCMAKE_CXX_FLAGS_INIT=/D_USE_MATH_DEFINES' visp: generate_dummy_package_with_run_deps: dep_name: visp From 39b7d996bdf5026482438392d80a110dd4f42bc7 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 11:06:17 +1000 Subject: [PATCH 16/17] velodyne_laserscan on Windows: export all symbols Its shared library exports no symbols, so MSVC writes no import library and velodyne_laserscan_node failed to link (LNK1181: cannot open input file 'Release\velodyne_laserscan.lib'). Co-Authored-By: Claude Opus 5.5 --- shared/pkg_additional_info.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/pkg_additional_info.yaml b/shared/pkg_additional_info.yaml index 0714bb355..3c342b744 100644 --- a/shared/pkg_additional_info.yaml +++ b/shared/pkg_additional_info.yaml @@ -179,10 +179,10 @@ urdfdom_py: generate_dummy_package_with_run_deps: dep_name: urdfdom-py max_pin: 'x.x' -velodyne_laserscan: # M_PI on Windows (pulled in by rtabmap_examples) +velodyne_laserscan: # Windows (pulled in by rtabmap_examples): M_PI, and its library exports no symbols additional_cmake_args: if: win - then: '-DCMAKE_CXX_FLAGS_INIT=/D_USE_MATH_DEFINES' + then: '-DCMAKE_CXX_FLAGS_INIT=/D_USE_MATH_DEFINES -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON' visp: generate_dummy_package_with_run_deps: dep_name: visp From e2e520d9c2be72344cc56e60e128930e0c5cff6f Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Sun, 25 Oct 2026 12:03:14 +1000 Subject: [PATCH 17/17] rtabmap_ros on Windows: without velodyne's driver velodyne_driver reads the sensor over POSIX sockets (netinet/in.h, C1083) and needs libpcap, so velodyne, velodyne_driver and velodyne_pointcloud are left out on Windows (packages_exclude also drops them from rtabmap_examples, which only uses them for its Velodyne launch files). Co-Authored-By: Claude Opus 5.5 --- shared/vinca.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shared/vinca.yaml b/shared/vinca.yaml index 5db12931e..3b365c34a 100644 --- a/shared/vinca.yaml +++ b/shared/vinca.yaml @@ -604,6 +604,14 @@ packages_select_by_deps: packages_exclude: + - if: win + then: + # velodyne_driver reads the sensor over POSIX sockets (and needs libpcap); also left + # out of the packages depending on them (rtabmap_examples) + - velodyne + - velodyne_driver + - velodyne_pointcloud + - if: not linux then: - pendulum_control