Skip to content

Commit

Permalink
Fixed cv_bridge.h build error on ros2 jazzy
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Jun 27, 2024
1 parent a217d2c commit e30b11c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ ELSE() # COLCON_BUILD
DEPENDENCIES std_msgs sensor_msgs
)
ament_export_dependencies(rosidl_default_runtime)

IF("$ENV{ROS_DISTRO}" STRLESS "iron")
add_definitions(-DPRE_ROS_IRON)
ENDIF()

###########
## Build ##
Expand Down
4 changes: 4 additions & 0 deletions src/ros2/CameraROS.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CAMERAROS_H_

#include <rclcpp/rclcpp.hpp>
#ifdef PRE_ROS_IRON
#include <cv_bridge/cv_bridge.h>
#else
#include <cv_bridge/cv_bridge.hpp>
#endif

#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
Expand Down
4 changes: 4 additions & 0 deletions src/ros2/FindObjectROS.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define FINDOBJECTROS_H_

#include <rclcpp/rclcpp.hpp>
#ifdef PRE_ROS_IRON
#include <cv_bridge/cv_bridge.h>
#else
#include <cv_bridge/cv_bridge.hpp>
#endif
#include <tf2_ros/transform_broadcaster.h>
#include "find_object/FindObject.h"

Expand Down
4 changes: 4 additions & 0 deletions src/ros2/print_objects_detected_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <message_filters/time_synchronizer.h>
#include <image_transport/image_transport.hpp>
#include <image_transport/subscriber_filter.hpp>
#ifdef PRE_ROS_IRON
#include <cv_bridge/cv_bridge.h>
#else
#include <cv_bridge/cv_bridge.hpp>
#endif
#include <opencv2/opencv.hpp>
#include <QTransform>
#include <QColor>
Expand Down

0 comments on commit e30b11c

Please sign in to comment.