Cannot exract image from bag file
I 'm using ROS and I'm trying to follow the tutorials on how to export image and video data from a bag file.I keep having this error When I execute roslaunch export.launch I got this error
> [FATAL] [1394490530.406789364]: Error opening file: play
[rosbag-1] process has died [pid 14368, exit code 1, cmd /opt/ros/hydro/lib/rosbag/play play -d 2 /home/khmarehman/test.bag __name:=rosbag __log:=/home/khmarehman/.ros/log/7b66fb3a-a896-11e3-b8eb-f4b7e2c88a9b/rosbag-1.log].
log file: /home/khmarehman/.ros/log/7b66fb3a-a896-11e3-b8eb-f4b7e2c88a9b/rosbag-1*.log
My code
<launch>
<node pkg="rosbag" type="play" name="rosbag" args="play -d 2 /home/khmarehman/test.bag"/>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="node">
<remap from="image" to="/camera/image_raw"/>
</node>
</launch>
UPDATE: I change my code to this
<launch>
<node pkg="rosbag" type="play" name="rosbag" args="-d 2 /home/khmarehman/test.bag"/>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
<remap from="image" to="/camera/image_raw"/>
</node>
</launch>
Now it got stuck at
core service [/rosout] found
process[rosbag-1]: started with pid [15230]
process[extract-2]: started with pid [15242]
[ INFO] [1394492914.265667303]: Initialized sec per frame to 0.100000
UPDATE: I change the code
<launch>
<node pkg="rosbag" type="play" name="rosbag" args="play -d 2 /home/khmarehman/test.bag">
<node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="node">
<remap from="image" to="/front/camera/image_rect_color/compressed"> </remap>
</node>
</node>
</launch>
still having this error
WARNING: WARN: unrecognized 'node' tag in <node> tag. Node xml is <node args="play -d 2 /home/khmarehman/test.bag" name="rosbag" pkg="rosbag" type="play"> <node cwd="node" name="extract" output="screen" pkg="image_view" respawn="false" type="extract_images"> <remap from="image" to="/front/camera/image_rect_color/compressed"> </remap></node></node>
[FATAL] [1394533222.650188690]: Error opening file: play
[rosbag-1] process has died [pid 20032, exit code 1, cmd /opt/ros/hydro/lib/rosbag/play play -d 2 /home/khmarehman/test.bag __name:=rosbag __log:=/home/khmarehman/.ros/log/2b6a1e2e-a903-11e3-aca7-f4b7e2c88a9b/rosbag-1.log].
log file: /home/khmarehman/.ros/log/2b6a1e2e-a903-11e3-aca7-f4b7e2c88a9b/rosbag-1*.log
BAG info
path: test.bag
version: 2.0
duration: 2:10s (130s)
start: Feb 03 2014 07:21:42.82 (1391394102.82)
end: Feb 03 2014 07:23:53.55 (1391394233.55)
size: 47.3 MB
messages: 1056
compression: none [61/61 chunks]
types: sensor_msgs/CompressedImage [8f7a12909da2c9d3332d540a0977563f]
topics: /front_camera/camera/image_rect_color/compressed 1056 msgs : sensor_msgs/CompressedImage
Is there anything in the logs that it mentions? Have you tried running the same command by hand?
Sorry, I couldn't understand, what do you mean by hand?
My updated code worked, But I couldn't find images, they are not in .ros
Rather than running those commands as part of a launch file, try running each command via rosrun and examining the output.
I am following this tutorial http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data
I suspect you're not seeing any images because there aren't any images in your bag file on the topic you've specified. You should be able to see which topics are in your bag file, what their types are, and how many messages were recorded on each topic by running `rosbag info` on your bag file.
I have edited and posted bag info