I am recording data from a range scanner with "sick_scan_xd" on ROS Melodic using the following command:
rosbag record -o nav310_ws/bagFiles/session --split --duration=1 --max-splits 1 /cloud
where nav310_ws/bagFiles
is the folder where the latest bag file is temporarily stored.
I was wondering how to save every recorded bag files, or copy each bag file to another folder, e.g., allBags
.
I tried the following command just after the first one, but it did not do anything.
cp -a nav310_ws/bagFiles/. nav310_ws/allBags/
My complete recording code is given below:
#!/bin/bash
rm -f nav310_ws/bagFiles/*
while true; do # Runs on a loop until stopped with CTRL+C
rosbag record -o nav310_ws/bagFiles/session --split --duration=1 --max-splits 1 /cloud
done
Thank you for any suggestion you could provide.