Ask Your Question
0

Download video data from robot camera

asked 2020-04-16 10:46:11 -0500

jean01 gravatar image

Hello everyone,

I have collected sensor data from my parot uav model with the following commands

roscore

rostopic list

rosbag record -O subset /drone/imu

rostopic echo -b subset.bag -p /drone/imu > data.csv

When I tried the same method to download camera data as video or image sets, the downlodaded file can not be opened

rosbag record -O subset /drone/front_camera/image_raw/compressed

rostopic echo -b subset.bag -p /drone/front_camera/image_raw/compressed > data.mp4

What can be the reason for that? The image_raw files are being recorded as a .bag file, but I can't download and see it in my computer. Am I making a mistake with the video or image format I am trying to download?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-25 15:20:47 -0500

pring gravatar image

updated 2020-04-25 15:22:07 -0500

Edit: actually did a quick search and found this to be helpful: http://wiki.ros.org/rosbag/Tutorials/...

It would be awesome if dealing with images could be so easy! Unfortunately that is not the case :/

A few things: 1) The */image_raw/compressed topic is actually of the rosmsg type sensor_msgs/CompressedImage.

lol@lel:~$ rosmsg info sensor_msgs/CompressedImage                                                                      
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string format
uint8[] data

The data field is the actual payload, which needs to be converted into a jpg/png as per the official structure: https://en.wikipedia.org/wiki/JPEG#Sy...

One way to do this is to use the cv_bridge to subscribe to the image topic, and then save to jpg/png on every run of the callback. (really there should be a node to do this .. but I can't find one :/ if you find one, please share!)

Once you have all of those jpgs, then can you coallate them into an mp4 video https://stackoverflow.com/questions/2...

I hope this helps. Good luck!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-04-16 10:46:11 -0500

Seen: 84 times

Last updated: Apr 25 '20