Skip to content

Commit e71c4b6

Browse files
robostack-bot-dev[bot]osicodesTobias-Fischerclaude
authored
Add rtabmap_rviz_plugins (#238)
* Add rtabmap_rviz_plugins * rtabmap_rviz_plugins: keep Qt 6 out of the plugin when RViz is Qt 5 conda-forge's VTK links Qt 6 (VTK::GUISupportQt and VTK::RenderingQt), and so does rtabmap's GUI. Both reach the plugin's link interface: rtabmap_conversions::rtabmap_conversions exports rtabmap::gui (Qt6::Widgets;Core;Gui;OpenGL) and rtabmap::core, whose interface lists pcl_visualization and VTK::GUISupportQt (Qt6::OpenGL;Widgets;OpenGLWidgets); pcl_conversions_LIBRARIES carries the same PCL/VTK list. With jazzy's and humble's Qt 5 RViz, CMake then fails with "INTERFACE_QT_MAJOR_VERSION of Qt6::OpenGL does not agree with QT_MAJOR_VERSION". The plugin uses none of them (only rtabmap/core and pcl_conversions headers), so when it is built with Qt 5 the patch drops the Qt 6 targets, VTK's Qt modules, rtabmap::gui and pcl_visualization from the imported targets' link interfaces and from the pcl_conversions-style _LIBRARIES variables. Distributions with a Qt 6 RViz (lyrical) don't find Qt5, and the block does nothing there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * jazzy, humble: build rtabmap_rviz_plugins The previous commit keeps VTK's and rtabmap's Qt 6 out of the Qt 5 plugin, so the exclusions go. humble keeps rtabmap without Qt and rtabmap_viz excluded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * humble: build rtabmap with Qt, and rtabmap_viz rtabmap was built with -DWITH_QT=OFF on humble (from the old ros-humble repo), so it had no GUI library and rtabmap_viz was excluded. Build it as jazzy does: with VTK's Qt 6, which adds librtabmap_gui (build number 26 to rebuild it). rtabmap_viz is a Qt 6 application of its own; rtabmap_rviz_plugins (Qt 5, like humble's RViz) keeps rtabmap's GUI out with the previous commit's patch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * humble: rtabmap_viz depends on rtabmap directly rtabmap_viz needs rtabmap's GUI component (find_package(RTABMap COMPONENTS gui)), but its package.xml only reaches rtabmap through rtabmap_sync. CI's parallel builds therefore built it next to the rebuilt rtabmap, against the published build without Qt: "Unsupported or not found required component: gui". As a direct dependency it is built after rtabmap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: osicodes <85848177+osicodes@users.noreply.github.com> Co-authored-by: Tobias Fischer <info@tobiasfischer.info> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9d1e0ba commit e71c4b6

6 files changed

Lines changed: 39 additions & 14 deletions

File tree

‎distros/humble/patch/dependencies.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ rtabmap:
170170
add_host: ["${{ 'libgl-devel' if linux }}", "${{ 'libopengl-devel' if linux }}", "ceres-solver", "${{ 'libdc1394' if not win }}", "libusb", "vtk"]
171171
remove_host: ["ros2-qt-gui-cpp"]
172172
remove_run: ["ros2-qt-gui-cpp"]
173+
rtabmap_viz: # find_package(RTABMap COMPONENTS gui): needs rtabmap built with Qt, built before it in parallel CI builds
174+
add_host: ["ros2-rtabmap"]
175+
add_run: ["ros2-rtabmap"]
173176
rviz_ogre_vendor:
174177
add_host: ["zlib", "freeimage", "freetype", "assimp", "zziplib", "pugixml", "${{ 'libglu' if linux }}"]
175178
add_build: ["vcstool"]

‎distros/humble/pkg_additional_info.yaml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ py_trees:
106106
dep_name: py-trees
107107
max_pin: 'x.x.x'
108108
override_version: 2.6.0
109-
rtabmap:
110-
additional_cmake_args:
111-
if: win
112-
then: "-DWITH_QT=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DWITH_GTSAM=OFF"
113-
else: "-DWITH_QT=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF"
114109
turtlebot3_node: # odometry.cpp uses M_PI
115110
additional_cmake_args:
116111
if: win
@@ -129,3 +124,9 @@ urdfdom_headers:
129124
# Remove build_number fields below on new full rebuild
130125
zenoh_cpp_vendor:
131126
additional_cmake_args: "-DAMENT_VENDOR_POLICY=NEVER_VENDOR_IGNORE_SATISFIED_CHECK -DUSE_SYSTEM_ZENOH=ON"
127+
rtabmap:
128+
additional_cmake_args:
129+
if: win
130+
then: "-DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DWITH_GTSAM=OFF"
131+
else: "-DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF"
132+
build_number: 26 # built with Qt (its GUI library, for rtabmap_viz)

‎distros/humble/vinca.yaml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ mutex_package:
1212
version: "0.12.0"
1313

1414
packages_exclude:
15-
- 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)
16-
- 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)
1715

1816
- if: not linux
1917
then:

‎distros/jazzy/vinca.yaml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@ build_number: 31
1212

1313
mutex_package:
1414
version: "0.21.0"
15-
16-
packages_exclude:
17-
- 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
18-

‎shared/patch/ros2-rtabmap-rviz-plugins.patch‎

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 4e47a68..4658ddb 100644
32
--- a/CMakeLists.txt
43
+++ b/CMakeLists.txt
5-
@@ -9,8 +9,7 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
4+
@@ -9,8 +9,7 @@
65
# issues #1285 #1288
76
find_library(
87
message_filters_LIB NAMES message_filters
@@ -12,7 +11,34 @@ index 4e47a68..4658ddb 100644
1211
)
1312
endif()
1413

15-
@@ -96,7 +95,7 @@ ENDIF()
14+
@@ -61,6 +60,26 @@
15+
rtabmap_msgs
16+
)
17+
18+
+# RoboStack: with a Qt 5 RViz, keep Qt 6 out of this plugin. conda-forge's VTK links Qt 6
19+
+# (VTK::GUISupportQt/RenderingQt, reached through PCL and rtabmap::core) and so does rtabmap's
20+
+# GUI (rtabmap::gui, exported by rtabmap_conversions). The plugin uses none of them.
21+
+if(Qt5_FOUND)
22+
+ set(_rs_qt6_regex "Qt6::|VTK::GUISupportQt|VTK::RenderingQt|rtabmap::gui|pcl_visualization")
23+
+ get_property(_rs_imported_targets DIRECTORY PROPERTY IMPORTED_TARGETS)
24+
+ foreach(_rs_target ${_rs_imported_targets})
25+
+ get_target_property(_rs_libs ${_rs_target} INTERFACE_LINK_LIBRARIES)
26+
+ if(_rs_libs)
27+
+ list(FILTER _rs_libs EXCLUDE REGEX "${_rs_qt6_regex}")
28+
+ set_property(TARGET ${_rs_target} PROPERTY INTERFACE_LINK_LIBRARIES "${_rs_libs}")
29+
+ endif()
30+
+ endforeach()
31+
+ foreach(_rs_pkg ${AmentLibraries})
32+
+ if(${_rs_pkg}_LIBRARIES)
33+
+ list(FILTER ${_rs_pkg}_LIBRARIES EXCLUDE REGEX "${_rs_qt6_regex}")
34+
+ endif()
35+
+ endforeach()
36+
+endif()
37+
+
38+
###########
39+
## Build ##
40+
###########
41+
@@ -96,7 +115,7 @@
1642

1743
# Causes the visibility macros to use dllexport rather than dllimport,
1844
# which is appropriate when building the dll but not consuming it.

‎shared/vinca.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ packages_select_by_deps:
335335
- rqt_runtime_monitor
336336
- rtabmap
337337
- rtabmap_ros # requested in https://github.com/RoboStack/ros-lyrical/pull/83
338+
- rtabmap_rviz_plugins
338339
- rtcm_msgs
339340
- rtest
340341
- rviz2

0 commit comments

Comments
 (0)