-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #193 This PR ports the existing image_transport tutorials from ROS 1 to ROS 2. The tutorial code now lives in a dedicated image_transport_tutorial package. The content from http://wiki.ros.org/image_transport/Tutorials is presented in the README and has been updated to work for ROS 2. Signed-off-by: Rebecca Butler <[email protected]>
- Loading branch information
1 parent
5b6f1b9
commit 8cef3db
Showing
22 changed files
with
753 additions
and
224 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
image_transport/tutorial/include/image_transport_tutorial/resized_publisher.hpp
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
image_transport/tutorial/include/image_transport_tutorial/resized_subscriber.hpp
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(image_transport_tutorial) | ||
|
||
# Default to C++17 | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(cv_bridge REQUIRED) | ||
find_package(image_transport REQUIRED) | ||
find_package(OpenCV REQUIRED) | ||
find_package(pluginlib REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
find_package(rosidl_default_generators REQUIRED) | ||
find_package(sensor_msgs REQUIRED) | ||
|
||
include_directories(include) | ||
|
||
# add the resized image message | ||
set(msg_files | ||
"msg/ResizedImage.msg" | ||
) | ||
rosidl_generate_interfaces(${PROJECT_NAME} | ||
${msg_files} | ||
DEPENDENCIES sensor_msgs | ||
) | ||
|
||
# add the publisher example | ||
add_executable(my_publisher src/my_publisher.cpp) | ||
ament_target_dependencies(my_publisher | ||
"cv_bridge" | ||
"image_transport" | ||
"OpenCV" | ||
"rclcpp") | ||
|
||
# add the subscriber example | ||
add_executable(my_subscriber src/my_subscriber.cpp) | ||
ament_target_dependencies(my_subscriber | ||
"cv_bridge" | ||
"image_transport" | ||
"OpenCV" | ||
"rclcpp") | ||
|
||
# add the plugin example | ||
add_library(resized_plugins src/manifest.cpp src/resized_publisher.cpp src/resized_subscriber.cpp) | ||
ament_target_dependencies(resized_plugins | ||
"image_transport" | ||
"OpenCV") | ||
|
||
# add the publisher from video example | ||
add_executable(publisher_from_video src/publisher_from_video.cpp) | ||
ament_target_dependencies(publisher_from_video | ||
"cv_bridge" | ||
"image_transport" | ||
"OpenCV" | ||
"rclcpp") | ||
|
||
# Install plugin descriptions | ||
pluginlib_export_plugin_description_file(${PROJECT_NAME} resized_plugins.xml) | ||
|
||
# Link interface | ||
rosidl_target_interfaces(resized_plugins | ||
${PROJECT_NAME} "rosidl_typesupport_cpp") | ||
|
||
# Install executables | ||
install( | ||
TARGETS my_publisher my_subscriber resized_plugins publisher_from_video | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
# Install include directories | ||
install( | ||
DIRECTORY include/ | ||
DESTINATION include | ||
) | ||
|
||
ament_export_include_directories(include) | ||
ament_export_dependencies(cv_bridge image_transport pluginlib rosidl_default_runtime rclcpp sensor_msgs) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
ament_package() |
Oops, something went wrong.