Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
29 changes: 25 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ add_library(${PROJECT_NAME} SHARED
src/web_video_server.cpp
src/multipart_stream.cpp
src/streamer.cpp
src/subscriber.cpp
src/utils.cpp
)

Expand All @@ -61,14 +62,15 @@ target_link_libraries(${PROJECT_NAME}
async_web_server_cpp::async_web_server_cpp
pluginlib::pluginlib
rclcpp::rclcpp
${sensor_msgs_TARGETS}
rmw::rmw
Boost::boost
PRIVATE
rclcpp_components::component
)

add_library(${PROJECT_NAME}_streamers SHARED
src/streamers/image_transport_streamer.cpp
src/streamers/image_streamer.cpp
src/streamers/libav_streamer.cpp
src/streamers/h264_streamer.cpp
src/streamers/jpeg_streamers.cpp
Expand All @@ -92,7 +94,6 @@ target_link_libraries(${PROJECT_NAME}_streamers
${PROJECT_NAME}
async_web_server_cpp::async_web_server_cpp
cv_bridge::cv_bridge
image_transport::image_transport
pluginlib::pluginlib
rclcpp::rclcpp
${sensor_msgs_TARGETS}
Expand All @@ -104,6 +105,25 @@ target_link_libraries(${PROJECT_NAME}_streamers
${swscale_LIBRARIES}
)

add_library(${PROJECT_NAME}_subscribers SHARED
src/subscribers/image_transport_subscriber.cpp
)

target_include_directories(${PROJECT_NAME}_subscribers
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)

target_link_libraries(${PROJECT_NAME}_subscribers
Comment thread
bjsowa marked this conversation as resolved.
${PROJECT_NAME}
async_web_server_cpp::async_web_server_cpp
image_transport::image_transport
pluginlib::pluginlib
rclcpp::rclcpp
${sensor_msgs_TARGETS}
)

## Declare a cpp executable
add_executable(${PROJECT_NAME}_node
src/web_video_server_node.cpp
Expand All @@ -115,7 +135,8 @@ target_link_libraries(${PROJECT_NAME}_node

rclcpp_components_register_nodes(${PROJECT_NAME} "web_video_server::WebVideoServer")

pluginlib_export_plugin_description_file(web_video_server plugins.xml)
pluginlib_export_plugin_description_file(web_video_server streamer_plugins.xml)
pluginlib_export_plugin_description_file(web_video_server subscriber_plugins.xml)

#############
## Install ##
Expand All @@ -127,7 +148,7 @@ install(
)

install(
TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_streamers
TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_streamers ${PROJECT_NAME}_subscribers
EXPORT export_${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ This node provides HTTP streaming of ROS topics in various formats, making it ea

## Features

- Subscribe to ROS topics in multiple formats:
- image_transport

- Stream ROS image topics over HTTP in multiple formats:
- MJPEG (Motion JPEG)
- VP8 (WebM)
- VP9 (WebM)
- H264 (MP4)
- PNG streams
- ROS compressed image streams

- Query snapshots of image topics in multiple formats:
- JPEG
- PNG
- ROS compressed image
- Plugin-based architecture for easy addition of new streaming formats
- Plugin-based architecture for easy addition of new subscribers or streamer formats
- Adjustable quality, size, and other streaming parameters
- Web interface to browse available image topics
- Support for different QoS profiles in ROS 2
Expand Down Expand Up @@ -91,6 +95,7 @@ ros2 run web_video_server web_video_server
| `server_threads` | int | 1 | 1+ | Number of server threads for handling HTTP requests |
| `ros_threads` | int | 2 | 1+ | Number of threads for ROS message handling |
| `verbose` | bool | false | true, false | Enable verbose logging |
| `default_qos_profile` | string | "default" | "default", "system_default", "sensor_data", "services_default" | QoS profile for ROS 2 subscribers |
| `default_stream_type` | string | "mjpeg" | "mjpeg", "vp8", "vp9", "h264", "png", "ros_compressed" | Default format for video streams |
| `publish_rate` | double | -1.0 | -1.0 or positive value | Rate for republishing images (-1.0 means no republishing) |

Expand Down Expand Up @@ -210,6 +215,9 @@ The response is plain text in the form `stopped=<count>`, where `<count>` is the
## Creating custom streamer plugins
See the [custom streamer plugin tutorial](doc/custom-streamer-plugin.md) for information on how to write your own streamer plugins.

## Creating custom subscriber plugins
See the [custom subscriber plugin tutorial](doc/custom-subscriber-plugin.md) for information on how to write your own subscriber plugins.

## About
This project is released as part of the [Robot Web Tools](https://robotwebtools.github.io/) effort.

Expand Down
Loading
Loading