mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-02-11 09:20:40 +00:00
25 lines
710 B
Bash
Executable File
25 lines
710 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
# 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!"
|
|
|
|
# Your actual ROS node start command goes here
|
|
echo "[INFO] Starting ROS node..."
|
|
|
|
# Source ROS 2 Humble setup script (if we aren't using nix)
|
|
command -v ros2 || source /opt/ros/humble/setup.bash
|
|
|
|
# Source your workspace setup script
|
|
source $SCRIPT_DIR/../install/setup.bash
|
|
|
|
# Launch the ROS 2 node with the desired mode
|
|
ros2 launch anchor_pkg rover.launch.py mode:=anchor
|