Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions distros/humble/patch/ros2-rtabmap-util.patch
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions distros/humble/vinca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ 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
then:
Expand Down
3 changes: 3 additions & 0 deletions distros/jazzy/vinca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions shared/patch/ros2-rtabmap-conversions.patch
Original file line number Diff line number Diff line change
@@ -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 <sensor_msgs/msg/point_cloud2.hpp>

#include <opencv2/opencv.hpp>
+#if CV_MAJOR_VERSION < 5
#include <opencv2/features2d/features2d.hpp>
+#else
+#include <opencv2/features.hpp>
+#endif
#ifdef PRE_ROS_IRON
#include <cv_bridge/cv_bridge.h>
#else
14 changes: 14 additions & 0 deletions shared/patch/ros2-rtabmap-odom.patch
Original file line number Diff line number Diff line change
@@ -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()

14 changes: 14 additions & 0 deletions shared/patch/ros2-rtabmap-rviz-plugins.patch
Original file line number Diff line number Diff line change
@@ -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()

27 changes: 27 additions & 0 deletions shared/patch/ros2-rtabmap-slam.patch
Original file line number Diff line number Diff line change
@@ -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
{
30 changes: 30 additions & 0 deletions shared/patch/ros2-rtabmap-viz.patch
Original file line number Diff line number Diff line change
@@ -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 <rtabmap/gui/MainWindow.h>
#include <rtabmap/utilite/ULogger.h>
#include <signal.h>
+#include <QSurfaceFormat>
+#include <vtkVersionMacros.h>
+#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
+#include <QVTKRenderWidget.h>
+#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() ) );

6 changes: 6 additions & 0 deletions shared/tests/ros2-rtabmap-slam.yaml
Original file line number Diff line number Diff line change
@@ -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)"
1 change: 1 addition & 0 deletions shared/vinca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down