0
$\begingroup$

Rosanswers logo

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


Originally posted by Jérôme on ROS Answers with karma: 36 on 2013-06-10

Post score: 0


Original comments

Comment by Procópio on 2013-06-10:
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?

Comment by Jérôme on 2013-06-11:
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) !

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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


Edit: or epfl-lasa/record_ros.


Originally posted by gvdhoorn with karma: 86574 on 2017-01-01

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by ahendrix with karma: 47576 on 2016-12-31

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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