Skip to content
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

Use cv_bridge hpp headers when available #149

Merged
merged 1 commit into from
Sep 30, 2024
Merged
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ endif()
## Build ##
###########

if(${cv_bridge_VERSION} VERSION_LESS "3.3.0")
add_compile_definitions(CV_BRIDGE_USES_OLD_HEADERS)
endif()

## Specify additional locations of header files
include_directories(include
${Boost_INCLUDE_DIRS}
Expand Down
6 changes: 6 additions & 0 deletions include/web_video_server/web_video_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
#define WEB_VIDEO_SERVER_H_

#include <rclcpp/rclcpp.hpp>

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

#include <vector>
#include "web_video_server/image_streamer.h"
#include "async_web_server_cpp/http_server.hpp"
Expand Down
6 changes: 6 additions & 0 deletions src/image_streamer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#include "web_video_server/image_streamer.h"

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

#include <iostream>

namespace web_video_server
Expand Down