Save image and depth topic from bag file to data frame or csv
I have a bag file that contains image and depth data. I know how to extract images and convert them to a video, but I would also like to extract the data and save it into one big csv/txt/h5/... (one file for all timesteps per topic).
I tried using this command:
rostopic echo -b ./data/recorded_bag_files/4.bag -p /camera/depth/image_rect_raw > ./data/recorded_bag_files/4_depth.csv
and equally for color:
rostopic echo -b ./data/recorded_bag_files/4.bag -p /camera/color/image_raw > ./data/recorded_bag_files/4_color.csv
.. but it only saves the meta data. Without the -p it seems to work, but then it's not easily readable via Python. Any other ideas?
I use: Ubuntu 20.04. ROS Noetic, Python 3.7
Update: I think this error only occurs on ROS Noetic, seems to work in ROS Melodic.