diff --git a/auto_start/auto_start_anchor.sh b/auto_start/auto_start_anchor.sh index f4dc31d..fa89ae9 100755 --- a/auto_start/auto_start_anchor.sh +++ b/auto_start/auto_start_anchor.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +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..." @@ -15,7 +17,7 @@ echo "[INFO] Starting ROS node..." source /opt/ros/humble/setup.bash # Source your workspace setup script -source $(dirname $0)/../install/setup.bash +source $SCRIPT_DIR/../install/setup.bash # Launch the ROS 2 node with the desired mode ros2 launch anchor_pkg rover.launch.py mode:=anchor diff --git a/auto_start/auto_start_headless_full.sh b/auto_start/auto_start_headless_full.sh index 68c9a5f..2d65482 100755 --- a/auto_start/auto_start_headless_full.sh +++ b/auto_start/auto_start_headless_full.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +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..." @@ -15,7 +17,7 @@ echo "[INFO] Starting ROS node..." source /opt/ros/humble/setup.bash # Source your workspace setup script -source $(dirname $0)/../install/setup.bash +source $SCRIPT_DIR/../install/setup.bash # Launch the ROS 2 node ros2 run headless_pkg headless_full diff --git a/auto_start/start_rosbag.sh b/auto_start/start_rosbag.sh index 3732bfe..98131eb 100755 --- a/auto_start/start_rosbag.sh +++ b/auto_start/start_rosbag.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash -ANCHOR_WS="$(dirname $0)/.." +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +ANCHOR_WS="$SCRIPT_DIR/.." AUTONOMY_WS="$ANCHOR_WS/../rover-Autonomy" BAG_LOCATION="$ANCHOR_WS/../bags/autostart"