diff --git a/misc/deploy.sh b/misc/deploy.sh index c52cf47a..07d88944 100755 --- a/misc/deploy.sh +++ b/misc/deploy.sh @@ -8,9 +8,9 @@ branch="" needsReboot=false calFile="" -cd .. -dirPath="$(pwd)" -dirName="$(basename `pwd`)" +export dirPath="$(catkin locate)" +if [ -z "$dirPath" ]; then dirPath=$(dirname "$0"); fi +dirName="$(basename $dirPath)" #Functions #-------------------------------------------------------------------------- diff --git a/misc/rover_launch_local.sh b/misc/rover_launch_local.sh index 209e05a4..26422a3b 100755 --- a/misc/rover_launch_local.sh +++ b/misc/rover_launch_local.sh @@ -1,3 +1,5 @@ #!/bin/bash +export SWARMATHON_APP_ROOT="$(catkin locate)" +if [ -z "$SWARMATHON_APP_ROOT" ]; then SWARMATHON_APP_ROOT=$(dirname "$0"); fi roscore & -./rover_onboard_node_launch.sh localhost $1 +$SWARMATHON_APP_ROOT/misc/rover_onboard_node_launch.sh localhost $1 diff --git a/run.sh b/run.sh index 04e3ec16..ba14cb9a 100755 --- a/run.sh +++ b/run.sh @@ -1,18 +1,19 @@ #!/bin/bash -echo "Running in $PWD" previous_gazebo_model_path=${GAZEBO_MODEL_PATH} previous_gazebo_plugin_path=${GAZEBO_PLUGIN_PATH} -export SWARMATHON_APP_ROOT="$PWD" -export GAZEBO_MODEL_PATH="$PWD/simulation/models" -export GAZEBO_PLUGIN_PATH="$PWD/build/gazebo_plugins" -source "$PWD/devel/setup.bash" +export SWARMATHON_APP_ROOT="$(catkin locate)" +if [ -z "$SWARMATHON_APP_ROOT" ]; then SWARMATHON_APP_ROOT=$(dirname "$0"); fi +echo "Running from: $PWD with repo root: $SWARMATHON_APP_ROOT" +export GAZEBO_MODEL_PATH="$SWARMATHON_APP_ROOT/simulation/models" +export GAZEBO_PLUGIN_PATH="$SWARMATHON_APP_ROOT/build/gazebo_plugins" +source "$SWARMATHON_APP_ROOT/devel/setup.bash" echo Cleaning up ROS and Gazebo Processes #Delete the rqt cache - can take 24 hours for changes in the UI # to show up otherwise rm ~/.config/ros.org/rqt_gui.ini -./cleanup.sh +$SWARMATHON_APP_ROOT/cleanup.sh echo Killing rosmaster pkill rosmaster echo Killing roscore @@ -28,7 +29,7 @@ echo Killing rosmaster pkill rosmaster echo Killing roscore pkill roscore -./cleanup.sh +$SWARMATHON_APP_ROOT/cleanup.sh # Restore previous environment export GAZEBO_MODEL_PATH=$previous_gazebo_model_path export GAZEBO_PLUGIN_PATH=$previous_gazebo_plugin_path