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

intermittent recording of Kinect inputs using rosbag

asked 2012-08-15 00:55:13 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I'd like to record a bag file of Kinect data, which can be run on RGBDSLAM later, as is instructed here. Everything works perfectly, but for my own experiment I would like to record the bag files intermittently, instead of capturing a continuous stream from Kinect.

The purpose is to get data at a very low frequency(say, having a time interval of 10 seconds between 2 inputs), so that I can have a bag file which contains images and depth information from a long time period (20 minutes, for example) while keeping the minimal amount of necessary data. In other words, I would like to get a single frame every 10 seconds or so for the bag file.

I suppose I can do this in a pretty ugly way, which is to run openni_node.launch on and off in one terminal, with rosbag record -O running in another terminal. But that is actually capturing continuous input in an impulse of time and then stop it, instead of capturing one single frame(as we press "Enter" running the RGBDSLAM with the GUI).

As I am new to ROS, I don't know how to do this, and there seemed no related discussion on this issue. Any suggestion would be greatly appreciated!

edit retag flag offensive close merge delete

Comments

1

Thanks piyushk for the info. Now it is working for online RGBDSLAM, but running offline produces nothing in the screen, even though I have modified the topic config in rgbdslam.launch. Any suggestion?

testingrosanswer gravatar image testingrosanswer  ( 2012-08-16 20:46:59 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2012-08-15 09:06:33 -0500

You can use this node: http://www.ros.org/wiki/topic_tools/throttle

It takes in an arbitrary message topic and republishes the message at a desired rate. You can then record the republished message.

edit flag offensive delete link more
1

answered 2012-08-22 22:46:10 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

An alternative is to use the GUI from dynamic_reconfigure to set the data_skip parameter of openni_camera. It will only let you reduce the framerate to 3 Hz (and not 0.1 Hz, as you propose), but at 0.1 Hz you won't get any sensible output out of RGBDSLAM anyway (except if the robot is not moving at all in those 10 seconds).

The advantage of this over the topic_tools solution is that you turn down the publishing frequency at the source, so you save a little computation time. The downside is that all subscribers get the point clouds at low frequency.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-08-15 00:55:13 -0500

Seen: 980 times

Last updated: Aug 22 '12