Thank you for the response.
I tried using keep() and I do not drop frames anymore. However, when I try to take a 20 second video, I realize my video is only 9 seconds. I realized the rosbag video cuts off prematurely, before all 20 seconds of the streams are written to the bag.
My code is as follows:
pipeline = rs.pipeline() config = rs.config() config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30) config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, 30) config.enable_record_to_file('test.bag') pipeline.start(config) try: start = time.time() while time.time()-start < 20: pipeline.wait_for_frames().keep() finally: pipeline.stop()
I'm guessing that the pipeline stops when only 9 seconds of the stream has been written to the bag.
Is there a workaround for this?
Thanks in advance!
With rosbags, you can set a maximum duration for a recording. I believe that in Librealsense, the TIME_MAX instruction is used for this.
For a well-informed answer about how to write a TIME_MAX instruction, posting a help request on the RealSense 'Issues' GitHub would be a good move. On the Issues page, you can click the 'New issues' button to post a question.