mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-02-11 09:20:40 +00:00
feat: start rosbag on boot
This commit is contained in:
22
auto_start/start_rosbag.sh
Normal file
22
auto_start/start_rosbag.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
ANCHOR_WS="/home/clucky/rover-ros2"
|
||||
AUTONOMY_WS="/home/clucky/rover-Autonomy"
|
||||
BAG_LOCATION="/home/clucky/bags/autostart"
|
||||
|
||||
# Wait for a network interface to be up (not necessarily online)
|
||||
while ! ip link show | grep -q "state UP"; do
|
||||
echo "[INFO] Waiting for active network interface..."
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "[INFO] Network interface is up!"
|
||||
|
||||
|
||||
source /opt/ros/humble/setup.bash
|
||||
source $ANCHOR_WS/install/setup.bash
|
||||
[ -f $AUTONOMY_WS/install/setup.bash ] && source $AUTONOMY_WS/install/setup.bash
|
||||
|
||||
cd $BAG_LOCATION
|
||||
|
||||
ros2 bag record -a
|
||||
Reference in New Issue
Block a user