ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Is it possible to connect to a video stream with Rviz?

asked 2023-05-11 19:30:45 -0600

lakofe8746 gravatar image


For our term project, we need to make a robot that can map the places it travels. We are thinking of using Rviz for this, but we want to install ROS on the computer to which the robot will be connected, not on the Raspberry Pi on the robot. If we broadcast with ffmpeg from the robot camera, can we listen to this broadcast with Rviz and create the map? How possible is this?

edit retag flag offensive close merge delete


Potentially a duplicate of where there are multiple answers posted?

130s gravatar image 130s  ( 2023-05-17 15:05:41 -0600 )edit

I don't think this question is a duplicate. There are answers about screen recording and I asked about video streaming.

lakofe8746 gravatar image lakofe8746  ( 2023-05-17 15:53:04 -0600 )edit

My bad, I took your question wrong.

130s gravatar image 130s  ( 2023-05-17 16:15:01 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2023-05-12 08:42:40 -0600

Mike Scheutzow gravatar image

No, what you propose will not work. rviz has no way to decode a video stream, and it has no way to analyze video to turn it into a map.

The algorithms to create a 2D map from data are called "SLAM", in particular "Visual SLAM" if the input data is camera images. There are many existing SLAM implementations for you to chose from. Start with a web search.

Be aware that nearly all of these implementations want the robot to frequently report its estimated position ("odometry"), so you're going to need a way to obtain that data.

edit flag offensive delete link more


Thank you for your response, since I'm a newbie, I really need some guidance here. I have another question. As far as I understand, ROS consists of modules. I mentioned that we will transfer video to another computer with Raspberry Pi, which ROS module would be sufficient for this? Would ros-noetic-rosbridge-server is enough for that task? We will install the module containing RViz on the other computer.

lakofe8746 gravatar image lakofe8746  ( 2023-05-17 15:00:51 -0600 )edit

we will transfer video to another computer

There is no standard ros package I know of that provides a good way to transfer video. Nearly everyone creates their own video solution using non-ros apps like gstreamer.

Would ros-noetic-rosbridge-server is enough for that task?

You are aware that every ros package has a wiki page on that describes it in detail, right? Do a web search and append after your search terms. That said, I believe rosbridge relies on json: that's not going to handle large binary messages very efficiently.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-05-18 07:37:21 -0600 )edit

answered 2023-06-27 21:26:00 -0600

It is possible if you install ROS on both your PC and the Raspberry Pi.

(1) Connect them by the "master-host" michanism of ROS.

(2) Bring up the ROS driver for the camera to publish the image stream of the camera to a topic

(3) You can see the video in rviz of your PC by subscribing that topic.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2023-05-11 19:30:45 -0600

Seen: 177 times

Last updated: Jun 27