Skip to content

Commit

Permalink
use cv_bridge.hpp header for newer cv_bridge versions
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Jan 24, 2023
1 parent 97b0649 commit eb3a9b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ find_package(Eigen3 REQUIRED)
find_package(Threads REQUIRED)
find_package(apriltag 3.2 REQUIRED)

if(cv_bridge_VERSION VERSION_GREATER_EQUAL 3.3.0)
add_compile_definitions(cv_bridge_HPP)
endif()

add_library(tags OBJECT src/tag_functions.cpp)
target_link_libraries(tags apriltag::apriltag)
set_property(TARGET tags PROPERTY POSITION_INDEPENDENT_CODE ON)
Expand Down
4 changes: 4 additions & 0 deletions src/AprilTagNode.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// ros
#include <apriltag_msgs/msg/april_tag_detection.hpp>
#include <apriltag_msgs/msg/april_tag_detection_array.hpp>
#ifdef cv_bridge_HPP
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
#include <image_transport/camera_subscriber.hpp>
#include <image_transport/image_transport.hpp>
#include <rclcpp/rclcpp.hpp>
Expand Down

0 comments on commit eb3a9b5

Please sign in to comment.