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

How to record bagfile within launch file

asked 2017-01-09 04:42:45 -0600

baozhang gravatar image

I would like to record some topics via launch file.

<launch>

<!-- record topics listed below -->
<arg name="topics_name" default="joint_states /usb_cam/left/image_raw"/>

<!-- record topics -->
<node name="record_topics_for_verification" pkg="rosbag" type="record"
      args="$(arg topics_name)"/>

</launch>

This code runs without any errors, however, there is no recorded bagfile in current directory.

Does anyone know the reason?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-09 05:50:38 -0600

DavidN gravatar image

updated 2017-01-09 05:50:57 -0600

By default, the bag file will be in ~/.ros folder with the name being the date and time of starting recording. For exact name, you can add this flag output="screen" so it looks like this

<node name="record_topics_for_verification" pkg="rosbag" type="record" args="$(arg topics_name)" output="screen"/>

After adding this flag, you will see the bag name in rosout after you launch.

Note: the bag file will have the name of xxx.bag.active while being recording. Only after you properly terminate the recording node, the file name will be changed to xxx.bag

edit flag offensive delete link more

Comments

Thank you for replying.

I found recorded bagfiles in ~/.ros folder.

Do you know how to change the folder to record bagfiles?

baozhang gravatar image baozhang  ( 2017-01-09 21:28:41 -0600 )edit

You can add -o in args list. Follow this: http://answers.ros.org/question/10612...

DavidN gravatar image DavidN  ( 2017-01-09 21:48:24 -0600 )edit

Thank you for your kindness. My question was solved!

baozhang gravatar image baozhang  ( 2017-01-10 09:18:50 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-09 04:42:45 -0600

Seen: 3,440 times

Last updated: Jan 09 '17