0
$\begingroup$

Rosanswers logo

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

Originally posted by Mechatronics on ROS Answers with karma: 11 on 2014-03-10

Post score: 1


Original comments

Comment by ahendrix on 2014-03-10:
Is there anything in the logs that it mentions? Have you tried running the same command by hand?

Comment by Mechatronics on 2014-03-10:
Sorry, I couldn't understand, what do you mean by hand?

Comment by Mechatronics on 2014-03-10:
My updated code worked, But I couldn't find images, they are not in .ros

Comment by ahendrix on 2014-03-10:
Rather than running those commands as part of a launch file, try running each command via rosrun and examining the output.

Comment by Mechatronics on 2014-03-10:
I am following this tutorial http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data

Comment by ahendrix on 2014-03-10:
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.

Comment by Mechatronics on 2014-03-11:
I have edited and posted bag info

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Looking at your bag file info, your camera topic is /front_camera/camera/image_rect_color/compressed ; you should use this topic to extract images.

The third launch example that you posted doesn't close the first <node> tag properly, which is why you're seeing an error there.

Therefore, your launch file should be something like:

<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="/front_camera/camera/image_rect_color/compressed"/>
  </node>
</launch>

And this may or may not work because you've only recorded compressed images in your bag file. You may also need to set the image_transport parameter to compressed to the extraact_images node.


Originally posted by ahendrix with karma: 47576 on 2014-03-11

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Mechatronics on 2014-03-11:
[ WARN] [1394587065.265630274]: [image_transport] It looks like you are trying to subscribe directly to a transport-specific image topic '/front_camera/camera/image_rect_color/compressed', in which case you will likely get a connection error. Try subscribing to the base topic '/front_camera/camera/image_rect_color' instead with parameter ~image_transport set to 'compressed' (on the command line, _image_transport:=compressed). See http://ros.org/wiki/image_transport for details.

Comment by Mechatronics on 2014-03-11:
[ERROR] [1394587065.463501301]: Client [/extract] wants topic /front_camera/camera/image_rect_color/compressed to have datatype/md5sum [sensor_msgs/Image/060021388200f6f0f447d0fcd9c64743], but our version has [sensor_msgs/CompressedImage/8f7a12909da2c9d3332d540a0977563f]. Dropping connection.

Comment by Mechatronics on 2014-03-11:
I am stuck again :(

Comment by ahendrix on 2014-03-11:
As noted, it looks like you should set the image_transport parameter to compressed for the extract_images node.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.