Skip to content

fix dependencies v2 #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: v2-main
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions orbbec_camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,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
Expand Down
4 changes: 2 additions & 2 deletions orbbec_camera/include/orbbec_camera/ob_camera_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
#include <fcntl.h>
#include <unistd.h>

#if defined(ROS_JAZZY) || defined(ROS_IRON)
#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#elif __has_include(<cv_bridge/cv_bridge.h>)
#include <cv_bridge/cv_bridge.h>
#endif

Expand Down
12 changes: 5 additions & 7 deletions orbbec_camera/include/orbbec_camera/ros_param_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
void addOnSetParametersCallback(T callback) {
ros_callback_ = node_->add_on_set_parameters_callback(callback);
}

private:
rclcpp::Node* node_;
Expand Down
1 change: 1 addition & 0 deletions orbbec_camera/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<depend>std_srvs</depend>
<depend>statistics_msgs</depend>
<depend>tf2</depend>
<depend>tf2_eigen</depend>
<depend>tf2_ros</depend>
<depend>tf2_sensor_msgs</depend>
<depend>tf2_msgs</depend>
Expand Down
4 changes: 2 additions & 2 deletions orbbec_camera/src/d2c_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*******************************************************************************/

#if defined(ROS_JAZZY) || defined(ROS_IRON)
#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#elif __has_include(<cv_bridge/cv_bridge.h>)
#include <cv_bridge/cv_bridge.h>
#endif
#include <sensor_msgs/image_encodings.hpp>
Expand Down
11 changes: 0 additions & 11 deletions orbbec_camera/src/ros_param_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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