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

How to use rosbag to take a snapshot of topics ?

asked 2013-06-10 06:28:29 -0600

Jérôme gravatar image

Hello everyone,

I am trying to record a snapshot of topics when I used a button of my joypad. A naive approach consist to specify a topic trigger for rosbag record.

I found something look good in the source code (github.com/ros/ros_comm/blob/groovy-devel/tools/rosbag/src/recorder.cpp) :

if (options_.snapshot)
{
    record_thread = boost::thread(boost::bind(&Recorder::doRecordSnapshotter, this));

    // Subscribe to the snapshot trigger
    trigger_sub = nh.subscribe<std_msgs::Empty>("snapshot_trigger", 100, boost::bind(&Recorder::snapshotTrigger, this, _1));
}

but I don't understand how to use this option !

Maybe someone can help me or suggest another way to capture topics when I want ?

Thanks

best regards

edit retag flag offensive close merge delete

Comments

what is the format you want for your snapshot? another bag file? or you just want to store the data, in a txt file, for example?

Procópio gravatar image Procópio  ( 2013-06-10 10:09:04 -0600 )edit

Thanks for you answer, I want to keep the bag file format, I know it's possible to develop something to do that, but if it's possible I prefer to use a standard way (like a rosbag record with option) !

Jérôme gravatar image Jérôme  ( 2013-06-11 05:07:27 -0600 )edit

3 Answers

Sort by » oldest newest most voted
0

answered 2017-01-01 11:56:45 -0600

gvdhoorn gravatar image

updated 2017-01-02 09:00:03 -0600

Not sure it fits your definition of snapshotting, but perhaps the osrf/nodelet_rosbag package can help you.


Edit: or epfl-lasa/record_ros.

edit flag offensive delete link more
1

answered 2016-12-31 14:17:05 -0600

ahendrix gravatar image

The rsobag wiki page does not document any options related to snapshotting, and from reading through the roabag source code I don't see any way to set the snapshot option you're referring to from the command line.

If you're feeling adventurous, you could try to write your own wrapper program for the rosbag Recorder object which sets the snapshot option; then it should listen on the snapshot_trigger topic and take a snapshot whenever a message is published on that topic.

edit flag offensive delete link more
0

answered 2016-12-31 05:13:08 -0600

Wolf gravatar image

What about letting rosbag permanently listen to a separate namespace and using a multiplexer to replicate your topics to this namespace in the moment you what to record the messages snapshot, the multiplexer is implemented in the topic tools, http://wiki.ros.org/topic_tools/mux

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-06-10 06:28:29 -0600

Seen: 1,256 times

Last updated: Jan 02 '17