Rosbag Record Until Disk is Almost Full
I am using ROS1 Noetic on a high altitude balloon payload running Ubuntu Mate 20.04 on a Raspberry Pi 4 collecting camera imagery and other sensor data. During the first flight it worked well but filled up the sd card and prevented future booting of the Pi. I could recover the data but never boot the Pi again. For the second flight, a more elegant solution is to stop the recording of ROS bags right before the disk fills up. The rosbag record
command has an argument for max_splits
, but it deletes existing files. I am more interested in the data it collects in the air at the beginning of the flight than the data of it sitting on the ground waiting to be recovered. Here is the record command I am using:
rosbag record -o ~/bagfiles/flight --split --size=4096
What is the most reliable way of stopping the rosbag recording just before the storage fills up?