sbrodeur / ros-icreate-bbb

ROS (Robotic Operating System) packages for the iRobot Create with onboard BeagleBone Black
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Convert rosbag files to video files for visualization #18

Closed sbrodeur closed 7 years ago

sbrodeur commented 7 years ago

We can use or adapt available source codes for that: https://github.com/OSUrobotics/bag2video https://github.com/mlaiacker/rosbag2video

sbrodeur commented 7 years ago

Video preview is now available with commit 8c39e61

preview

Check the videos below: visualization.zip

sbrodeur commented 7 years ago

There are more sensors/information that we could export to videos and display:

Support is to be added in file: https://github.com/sbrodeur/ros-icreate-bbb/blob/master/src/action/scripts/record/data/visualize_hdf5.py

sbrodeur commented 7 years ago

Currently, the implementation is very slow with Matplotlib generating animations. This should be optimized. See: http://bastibe.de/2013-05-30-speeding-up-matplotlib.html

It seems that the encoding process is responsible for the slow processing, even with simple codec (e.g rawvideo, mjpeg) compared to H.264. Using libx264 is still the fastest (33 FPS) and leads to smaller size videos. The only way to gain speed is to parallelize computation across CPU cores, but encoding multiple videos on different threads / processes. This would be easy since we have a lot of sensors to process, and this is done sequentially right now.

sbrodeur commented 7 years ago

See commit f6b1679 about how to use multiprocessing and downsampling to have considerable speedup.

sbrodeur commented 7 years ago

See commit 6fccca0 for the last visualizations that needed to be implemented.