intermittent recording of Kinect inputs using rosbag
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!
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?