From f11850d5bc328182ff122fb3a638e08743908664 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 26 Mar 2025 11:57:06 +0100 Subject: [PATCH 1/4] add missing dependency on 'tf2_eigen' --- orbbec_camera/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/orbbec_camera/package.xml b/orbbec_camera/package.xml index c5f4301d..4511cff7 100644 --- a/orbbec_camera/package.xml +++ b/orbbec_camera/package.xml @@ -25,6 +25,7 @@ std_srvs statistics_msgs tf2 + tf2_eigen tf2_ros tf2_sensor_msgs tf2_msgs From e493177fe9deadda68b5cc8e2401683000beaf0a Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 26 Mar 2025 13:51:38 +0100 Subject: [PATCH 2/4] replace custom definitions with '__has_include' header check --- orbbec_camera/include/orbbec_camera/ob_camera_node.h | 4 ++-- orbbec_camera/src/d2c_viewer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/orbbec_camera/include/orbbec_camera/ob_camera_node.h b/orbbec_camera/include/orbbec_camera/ob_camera_node.h index b98d0b7f..30b38645 100644 --- a/orbbec_camera/include/orbbec_camera/ob_camera_node.h +++ b/orbbec_camera/include/orbbec_camera/ob_camera_node.h @@ -64,9 +64,9 @@ #include "jpeg_decoder.h" #include -#if defined(ROS_JAZZY) || defined(ROS_IRON) +#if __has_include() #include -#else +#elif __has_include() #include #endif diff --git a/orbbec_camera/src/d2c_viewer.cpp b/orbbec_camera/src/d2c_viewer.cpp index 0a833251..d15c1528 100644 --- a/orbbec_camera/src/d2c_viewer.cpp +++ b/orbbec_camera/src/d2c_viewer.cpp @@ -14,9 +14,9 @@ * limitations under the License. *******************************************************************************/ -#if defined(ROS_JAZZY) || defined(ROS_IRON) +#if __has_include() #include -#else +#elif __has_include() #include #endif #include From 7ea8f40e5da012f45a5874fd17d5c7f2a34e1234 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 26 Mar 2025 14:48:23 +0100 Subject: [PATCH 3/4] replace switch of callback type via ROS distro check with template type --- orbbec_camera/CMakeLists.txt | 6 ------ .../include/orbbec_camera/ros_param_backend.h | 12 +++++------- orbbec_camera/src/ros_param_backend.cpp | 11 ----------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/orbbec_camera/CMakeLists.txt b/orbbec_camera/CMakeLists.txt index c219b27e..ed01f976 100644 --- a/orbbec_camera/CMakeLists.txt +++ b/orbbec_camera/CMakeLists.txt @@ -15,12 +15,6 @@ option(USE_NV_HW_DECODER "Use Nvidia hardware decoder" OFF) if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Werror -Wno-pedantic -Wno-array-bounds) endif () -# Check if ROS Jazzy or iron is installed -if ("$ENV{ROS_DISTRO}" STREQUAL "jazzy") - add_compile_definitions(ROS_JAZZY) -elseif ("$ENV{ROS_DISTRO}" STREQUAL "iron") - add_compile_definitions(ROS_IRON) -endif () # find dependencies set(dependencies diff --git a/orbbec_camera/include/orbbec_camera/ros_param_backend.h b/orbbec_camera/include/orbbec_camera/ros_param_backend.h index ecb4d3e3..b1f7154f 100644 --- a/orbbec_camera/include/orbbec_camera/ros_param_backend.h +++ b/orbbec_camera/include/orbbec_camera/ros_param_backend.h @@ -22,13 +22,11 @@ class ParametersBackend { public: explicit ParametersBackend(rclcpp::Node* node); ~ParametersBackend(); -#if defined(ROS_JAZZY) || defined(ROS_IRON) - void addOnSetParametersCallback( - rclcpp::node_interfaces::NodeParametersInterface::OnSetParametersCallbackType callback); -#else - void addOnSetParametersCallback( - rclcpp::node_interfaces::NodeParametersInterface::OnParametersSetCallbackType callback); -#endif + + template + void addOnSetParametersCallback(T callback) { + ros_callback_ = node_->add_on_set_parameters_callback(callback); + } private: rclcpp::Node* node_; diff --git a/orbbec_camera/src/ros_param_backend.cpp b/orbbec_camera/src/ros_param_backend.cpp index 4e67ff3a..0e172df6 100644 --- a/orbbec_camera/src/ros_param_backend.cpp +++ b/orbbec_camera/src/ros_param_backend.cpp @@ -26,16 +26,5 @@ ParametersBackend::~ParametersBackend() { ros_callback_.reset(); } } -#if defined(ROS_JAZZY) || defined(ROS_IRON) -void ParametersBackend::addOnSetParametersCallback( - rclcpp::node_interfaces::NodeParametersInterface::OnSetParametersCallbackType callback) { - ros_callback_ = node_->add_on_set_parameters_callback(callback); -} -#else -void ParametersBackend::addOnSetParametersCallback( - rclcpp::node_interfaces::NodeParametersInterface::OnParametersSetCallbackType callback) { - ros_callback_ = node_->add_on_set_parameters_callback(callback); -} -#endif } // namespace orbbec_camera From e2216b306a50a100f8a90ca5eeab2b3f458f4926 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 26 Mar 2025 15:25:56 +0100 Subject: [PATCH 4/4] add dependency 'opengl' to install 'libEGL.so.1' for 'libdepthengine.so.2.0' --- orbbec_camera/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/orbbec_camera/package.xml b/orbbec_camera/package.xml index 4511cff7..246b9bf0 100644 --- a/orbbec_camera/package.xml +++ b/orbbec_camera/package.xml @@ -35,6 +35,7 @@ nlohmann-json-dev libgoogle-glog-dev libdw-dev + opengl ament_cmake