This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# provide input.bag output_prefix time_fraction (0.0-1.0) | |
echo $1, $2, $3 | |
t0=`rosbag info -y -k start $1` | |
t1=`rosbag info -y -k end $1` | |
tfr=`echo "$t0 + ($t1 - $t0) * $3" | bc -l` | |
echo $t0, $t1, $tfr | |
# thalf=`echo "($(rosbag info -y -k start output.bag) + $(rosbag info -y -k end output.bag))/2.0" | bc -l` | |
rosbag filter $1 $2_a.bag "t.secs <= $tfr" | |
rosbag filter $1 $2_b.bag "t.secs > $tfr" |