How can I extract a depth image from a .bag file?
I would like to extract a depth image - a simple short int matrix - from a .bag file. This is what I tried with a launch file:
<launch>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" required="true" output="screen" cwd="ROS_HOME">
<remap from="image" to="/l515/depth/image_rect_raw"/>
</node>
</launch>
and then used
rosbag play my_file.bag
However the extractor gives me the following error message:
[ INFO] [1606132041.164919359]: Initialized sec per frame to 0.100000
[ERROR] [1606132047.642971073]: Unable to convert 16UC1 image to bgr8
[ WARN] [1606132047.643110024]: Couldn't save image, no data!
I would like to tell the system to just store the 16UC1 as is, not try to convert it to bgr8. But how do I do that?
I am sure that I am listening to the correct topic.
Any help is very much appreciated! Thanks a lot!