[ros-users] rosbag patch for pausing recording and status in…

Top Page
Attachments:
Message as email
+ (text/plain)
+ rosbag_patch.tar.gz (application/x-compressed-tar)
Delete this message
Reply to this message
Author: Bill Morris
Date:  
To: ros-users
Subject: [ros-users] rosbag patch for pausing recording and status information
I put together a patch for 'rosbag record' that provides a client/server
interface. The patch was created using svn diff.

The current status of rosbag record can be obtained by calling the
get_status service which provides the name of the current bag file being
recorded, the recording status and a list of the topics being recorded.
$ rosservice call /record_1280253194863995182/get_status
target_filename: foo_2010-07-27-13-53-14.bag
write_filename: foo_2010-07-27-13-53-14.bag.active
writing_enabled: True
topics: ['/chatter', '/rosout', '/rosout_agg']

Calling set_status to set writing_enabled to False provides a means of
pausing the recording of data to the current bag file.
$ rosservice call /record_1280253194863995182/set_status False
success: True

Here the updated status is shown in a another call to get_status
$ rosservice call /record_1280253194863995182/get_status
target_filename: foo_2010-07-27-13-53-14.bag
write_filename: foo_2010-07-27-13-53-14.bag.active
writing_enabled: False
topics: ['/chatter', '/rosout', '/rosout_agg']

Setting writing_enabled to true will resume logging.
$ rosservice call /record_1280253194863995182/set_status True
success: True

The output of rosbag record will look something like this
$ rosbag record -a -o foo
[ INFO] [1280253741.079472070]: Recording to
foo_2010-07-27-14-02-21.bag.
[ INFO] [1280253742.087486427]: Subscribing to /chatter
[ INFO] [1280253742.093223888]: Subscribing to /rosout
[ INFO] [1280253742.098384181]: Subscribing to /rosout_agg
[ INFO] [1280253772.239637479]: disabling message logging
[ WARN] [1280253772.240439047]: Not logging message because logging
disabled. Most likely cause is a full disk.
[ WARN] [1280253777.650501980]: Not logging message because logging
disabled. Most likely cause is a full disk.
[ INFO] [1280253784.865028834]: enabling message logging