ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Rosbag record in unexisting folder [closed]

asked 2013-04-23 04:30:24 -0500

updated 2013-04-23 06:13:10 -0500

Hi everybody,

I would like to know if anyone knows a solution when we record in a folder with rosbag, but that folder doesn't exist....

In my case, I found that rosbag just doesn't seems to save anything... But without any error message ! And that's a big problem, because my recording was just a "one shot" thing....

Is there any way to find the data somewhere ? (I tried ~/.ros, but nothing there)...

Thank you very much !


EDIT : if you launch rosbag record from a launch file, you have to let


otherwise the error message doesn't appears.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Stephane.M
close date 2013-04-23 06:13:40


How did you manage to record to a directory that doesn't exist? Did you delete the working directory where you ran rosbag while rosbag was running?

Martin Günther gravatar image Martin Günther  ( 2013-04-23 04:35:53 -0500 )edit

In fact, imagine I want to record in /home/data folder. So I recorded some things, saved them on an hard drive, but by doing that, I removed the folder data. When I relaunch rosbag record, nothing is saved, as the folder doesn't exist anymore.

Stephane.M gravatar image Stephane.M  ( 2013-04-23 04:43:37 -0500 )edit

And rosbag then behave "as if it was recording", without letting us know it's not recording at all.

Stephane.M gravatar image Stephane.M  ( 2013-04-23 04:44:22 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-04-23 05:33:06 -0500

To sum up my understanding of what happened: You started rosbag record in /home/data, and while rosbag was recording, you deleted that directory. The question is whether rosbag should print an error message if you do that. (Please correct me if I misunderstood your question.)

That's not a bug in rosbag, but a general design decision in Unix. As long as rosbag is still running, you can try to recover the file from /proc/pid/fd, otherwise maybe this will help (more information here).

BTW: If you delete /home/data before starting rosbag, you'll get an error saying that the file is not writable; only if you delete it while rosbag is recording, you'll lose the data.

edit flag offensive delete link more


No. I deleted the /home/data before starting rosbag. And I didn't get any error. Maybe it is because it is inside a launch file ? Example : "<node pkg="rosbag" type="record" name="record_kinect1_rgb" args="kinect1/rgb/image_raw kinect1/rgb/camera_info -o $(arg path)/kinect1_rgb"/> "

Stephane.M gravatar image Stephane.M  ( 2013-04-23 06:03:37 -0500 )edit

But anyway, thank you for your answer, it helped me to understand :-)

Stephane.M gravatar image Stephane.M  ( 2013-04-23 06:04:15 -0500 )edit

I made an test by adding output="screen" and indeed, it shows an error message... (I desactivated it because my launch files launch so many things that I only keep the interesting messages shown...). Thank you again, have a good day !

Stephane.M gravatar image Stephane.M  ( 2013-04-23 06:10:34 -0500 )edit

Glad I could help! :-)

Martin Günther gravatar image Martin Günther  ( 2013-04-23 06:48:12 -0500 )edit

Question Tools


Asked: 2013-04-23 04:30:24 -0500

Seen: 1,413 times

Last updated: Apr 23 '13