CWRUbotix / ros2_video_streamer

Python video streamer or camera simulator in ROS2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ros2_video_streamer

A ROS2 python node for streaming video files or images to a topic. Tailored launch file for 2023 MATE ROV competition.

CWRUBotix MATE ROV 2023

Use the three_camera_launch.py launch file without any parameters to launch three streams from the files bottom_cam.mp4, front_cam.mp4, and manip_cam.mp4. These files are not included in the Git repo to save space, so you need to manually place three video files with those names in src/ros2_video_streamer.

ros2 launch ros2_video_streamer three_camera_launch.py

This launcher will publish the streams on bottom_cam/image_raw, front_cam/image_raw, and manip_cam/image_raw.

If greater control is desired, see Custom Usage.

Custom Usage

Minimally, you need to provide the ros2_video_streamer_node_launch.py launch file a type (video or image) and path, or type:=video and camera_name. path is the path to the content to stream (relative to the ros2_video_streamer package directory), and camera_name is the name of a camera (e.g. front_cam) which the launch file uses to autofill various fields, including path, which it sets to <camera_name>.mp4.

ros2 launch ros2_video_streamer ros2_video_streamer_node_launch.py type:=video camera_name:=<name>
ros2 launch ros2_video_streamer ros2_video_streamer_node_launch.py type:=<type> path:=<path>

The content is published on the /simulated_cam/image_raw topic by default, but specifying camera_name will switch the topic to /<camera_name>/image_raw.

All Settings

These are all of the parameters which the launch file accepts.

  • camera_name - name of the camera (defaults to simulated_cam) which is used as the node namespace and autopopulates the following fields:

    • image_topic_name: /<camera_name>/image_raw
    • info_topic_name: /<camera_name>/camera_info
    • path: <camera_name>.mp4
  • node_name - Override the default name of the node.

  • image_topic_name - Override default name of the topic to publish images to

  • info_topic_name - Override default name of the topic to publish camera info to

  • config_file_name - Name of YAML file in the config folder. CameraInfo messages are published on the ~/camera_info topic based on the content of the config file. By default, nothing is published.

  • loop (true or false; defaults to true) - Continuously publish the source on loop

  • frame_id - Frame id string in the CameraInfo messages.

  • start (int) - Location to start publishing the source.

About

Python video streamer or camera simulator in ROS2

License:MIT License


Languages

Language:Python 100.0%