Skip to content

Commit e13545c

Browse files
committed
Update: fixed iron compile error
1 parent af39410 commit e13545c

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

orbbec_camera/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ option(USE_NV_HW_DECODER "Use Nvidia hardware decoder" OFF)
1515
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1616
add_compile_options(-Wall -Wextra -Werror -Wno-pedantic -Wno-array-bounds)
1717
endif ()
18-
# Check if ROS Jazzy is installed
19-
if("$ENV{ROS_DISTRO}" STREQUAL "jazzy")
18+
# Check if ROS Jazzy or iron is installed
19+
if ("$ENV{ROS_DISTRO}" STREQUAL "jazzy")
2020
add_compile_definitions(ROS_JAZZY)
21-
endif()
21+
elseif ("$ENV{ROS_DISTRO}" STREQUAL "iron")
22+
add_compile_definitions(ROS_IRON)
23+
endif ()
2224

2325
# find dependencies
2426
set(dependencies
@@ -220,12 +222,12 @@ install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/)
220222
install(DIRECTORY config DESTINATION share/${PROJECT_NAME}/)
221223
install(DIRECTORY ${ORBBEC_INCLUDE_DIR} DESTINATION include)
222224
install(DIRECTORY ${ORBBEC_LIBS_DIR}/ DESTINATION lib/ FILES_MATCHING PATTERN "*.so*")
223-
if(DEFINED ENV{BUILDING_PACKAGE})
225+
if (DEFINED ENV{BUILDING_PACKAGE})
224226
# Install udev rules
225227
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/99-obsensor-libusb.rules
226228
DESTINATION /etc/udev/rules.d
227229
)
228-
endif()
230+
endif ()
229231

230232
install(TARGETS list_devices_node
231233
list_depth_work_mode_node

orbbec_camera/include/orbbec_camera/ob_camera_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#include "jpeg_decoder.h"
6464
#include <std_msgs/msg/string.hpp>
6565

66-
#if defined(ROS_JAZZY)
66+
#if defined(ROS_JAZZY) || defined(ROS_IRON)
6767
#include <cv_bridge/cv_bridge.hpp>
6868
#else
6969
#include <cv_bridge/cv_bridge.h>

orbbec_camera/include/orbbec_camera/ros_param_backend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ParametersBackend {
2222
public:
2323
explicit ParametersBackend(rclcpp::Node* node);
2424
~ParametersBackend();
25-
#if defined(ROS_JAZZY)
25+
#if defined(ROS_JAZZY) || defined(ROS_IRON)
2626
void addOnSetParametersCallback(
2727
rclcpp::node_interfaces::NodeParametersInterface::OnSetParametersCallbackType callback);
2828
#else

orbbec_camera/src/d2c_viewer.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
/*******************************************************************************
2-
* Copyright (c) 2023 Orbbec 3D Technology, Inc
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*******************************************************************************/
16-
#if defined(ROS_JAZZY)
2+
* Copyright (c) 2023 Orbbec 3D Technology, Inc
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*******************************************************************************/
16+
17+
#if defined(ROS_JAZZY) || defined(ROS_IRON)
1718
#include <cv_bridge/cv_bridge.hpp>
1819
#else
1920
#include <cv_bridge/cv_bridge.h>

orbbec_camera/src/ros_param_backend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ParametersBackend::~ParametersBackend() {
2626
ros_callback_.reset();
2727
}
2828
}
29-
#if defined(ROS_JAZZY)
29+
#if defined(ROS_JAZZY) || defined(ROS_IRON)
3030
void ParametersBackend::addOnSetParametersCallback(
3131
rclcpp::node_interfaces::NodeParametersInterface::OnSetParametersCallbackType callback) {
3232
ros_callback_ = node_->add_on_set_parameters_callback(callback);

0 commit comments

Comments
 (0)