Rosanswers logo

Hi, I'm a newbie to ROS (and Linux too) so probably this is the most stupid question ever, but I swear I have followed the first tutorials on the wiki and I'm starting to learn little by little. I have downloaded a bag file (named carrello1.bag) which contains a lot of topic, including some images that I need to extract in order to process them with some image processing programs.

I've seen the tutorial "export image and video data from a bag file" that is literally the thing I have to do, and I setup my system doing all the Beginner Level Tutorials and creating a new package (provatesi) with the launch file (named provatesi.launch) - as in the tutorial and changing the directory

$(find image_view)/test.bag 


~ /home/mattia/Desktop/carrello1.bag

since the tutorial assumes that you have a .bag file previously created that is named test.bag and that this bag file is stored in the image_view package directory. But when I execute

$ roslaunch provatesi provatesi.launch

I get:

[FATAL] [1268662434.297981030]: Error opening file: ~/home/mattia/Desktop/carrello1.bag

Where am I making the mistake?

Originally posted by nujdilla on ROS Answers with karma: 3 on 2019-09-16

Post score: 0


1 Answer 1


Rosanswers logo

You're passing a path that is not an absolute path. See #q331346 for a related question.

To be precise, there are two issues here:

  1. ~/home/mattia/.. is not a valid path: ~ already evaluates to /home/mattia, so this would evaluate to /home/mattia/home/mattia.
  2. ~ is evaluated (ie: replaced) by the shell (ie: bash), not roslaunch. So roslaunch doesn't do anything with it and passes the path directly to whatever tool/node/script it is that you're trying to start. As ~ is not a valid path, it will fail to open it (as evidenced by the "Error opening file" that you see).

Originally posted by gvdhoorn with karma: 86574 on 2019-09-16

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by nujdilla on 2019-09-16:
Thank you! . Now that I corrected that, I have another type of error:

REQUIRED process [rosbag-2] has died!

This is my launch file

  <node pkg="rosbag" type="play" name="rosbag" required="true" args="/home/mattia/Desktop/carrello1.bag"/>
  <node name="extract" pkg="image_view" type="extract_images" respawn="false" required="true" output="screen" cwd="ROS_HOME">
    <remap from="image" to="/home/mattia/Desktop/camera"/>

Comment by jayess on 2019-09-16:
@nujdilla Since you have a new problem, you should probably open a new question

Comment by nujdilla on 2019-09-17:
I found the problem: the "to=" argument was wrong: it has to be the topic of the bag that contains the images. I have just finished successfully in extracting the images. Thank you nonetheless!


Your Answer

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