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

How to record a video of Turtlebot's view on Gazebo?

asked 2017-06-28 17:30:52 -0600

procyon gravatar image

I'm pretty new to ros, and I'd like to record the view of a turtlebot as it moves around. I want to do it by a python or cpp script, so, not like that:

Any ideas about how to do it or where to start?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-06-28 19:39:43 -0600

jayess gravatar image

Where to start:

Look at the source for the video_recorder node in the image_view package (which is what is used in the tutorial that you linked to). You'll notice that cv::VideoWriter from OpenCV is used. Next, checkout the API for the cv::VideoWriter class. This should be a good start for you.

edit flag offensive delete link more

answered 2018-05-30 06:20:13 -0600

kiran gravatar image

You can also look at rosbag. It allows you to record any topic in the bag format. If you are publishing the video on a specific topic you can record that using command line via rosbag record <video/topic>

Moreover, depending on the writing speed of the disk, rosbag may discard the data it needs to write. In such cases, it is suggested to increase the buffer size using rosbag record -b <buffer number in MB> <video/topic>. You can check all the available command line arguments in rosbag command line.

Since it is a command line you always run this using a script and run in even in a remote system. Hope this helps!

edit flag offensive delete link more

Question Tools



Asked: 2017-06-28 17:30:52 -0600

Seen: 1,100 times

Last updated: May 30 '18