0
$\begingroup$

I am a newcomer to using ROS and am facing the challenge of obtaining a video stream from the camera topic of my robot in Gazebo and transmitting this video via RTSP. I have attempted to use the gi library, but without success.

My goal is to capture the video from the robot's camera topic in Gazebo and stream it via RTSP for further processing. I also plan to process this video and transmit it via RTSP in the future.

Has anyone in the community encountered a similar task and could share their experience or suggest suitable tools and libraries for this task?

I would appreciate any advice and assistance.

Thank you!

$\endgroup$
1

1 Answer 1

0
$\begingroup$

Hay @Jazx!

I had the same issue, and spent a lot of time on finding solution. Unfortunately "amazing" Gazebo and ROS2 communities broke backward compatibility with old and perfectly working plugins and refusing to put any effort to port them to the new Gazebo sim. What makes it's even worse, since ROS2 Humble there was broken mess with libs witch causing crashes of ROS2 nodes each time when you gonna try to use GStreamer for RTSP streaming within same process (https://github.com/ros2/rclpy/issues/1149).

So, I did bad but working solution on python. You can look it here https://github.com/vdoom/PX4-ROS2-Gazebo-YOLOv8-PyTorchSSD

For me, when Gazebo, PX4 and other shit already running, I need 3 more Terminal windows.

Terminal_1 for starting image bridge from Gazebo to ROS2:

ros2 run ros_gz_image image_bridge /camera

Terminal_2 for starting GStreamer based RTSP server:

python3 rtsp_server.py

Terminal_3 for starting crutch which will receive camera image from ros2 and send to RTSP server via sockets:

python3 uav_camera_to_crutch_proxy.py

If you whant to test if RTSP is actually streaming anything you can run:

python3 open_rtsp.py

P.S. Hey, @Greenonline! Instead of removing my comments you'd better spent same effort for finding solution and help people.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.