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

How to use rosbag::Recorder (C++ API)

asked 2012-08-30 23:08:37 -0600

LetThemDance gravatar image

updated 2014-01-28 17:13:30 -0600

ngrennan gravatar image

Hello together,

I'm new to ROS. I want to record two camera topics to a bag-file with help of the c++ API of rosbag. In this namespace I found the class Recorder, which seems to work like the command line tool rosbag. Unfortunately this class has just a public function to run ( run() ) the recorder, but there is now function to stop it. Has somebody an idea how to use it? Or is it better to use the rosbag::write() function?

Thanks in advance Klaus

edit retag flag offensive close merge delete

Comments

I tried deleting the recorder object when I was done with it, but it dies messily usr/include/boost/thread/pthread/condition_variable.hpp:168: boost::condition_variable_any::~condition_variable_any(): Assertion !pthread_mutex_destroy(&internal_mutex)' failed. Aborted (core dumped)

lucasw gravatar image lucasw  ( 2015-09-23 11:46:53 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-03-08 06:11:53 -0600

amittleider gravatar image

I'm not sure about stopping the recording through the API, but an alternative solution may be to start/stop bagging when your camera nodes start/stop running. You can do this by including rosbag in your launch file. <node pkg="rosbag" name="record" args="-a -o /mybagdir/"/>.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-30 23:08:37 -0600

Seen: 1,452 times

Last updated: Aug 30 '12