From 3132798071f96a4022c623609e98a11e98ab66f1 Mon Sep 17 00:00:00 2001 From: Cameron Brown Date: Fri, 8 Nov 2024 21:51:25 -0500 Subject: [PATCH] scripts/setup.bash: Add disambig for running parallel simulations on a single computer --- scripts/setup.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/setup.bash b/scripts/setup.bash index c56efc21f..51b08d21f 100755 --- a/scripts/setup.bash +++ b/scripts/setup.bash @@ -198,6 +198,19 @@ prettycp() { rsync --recursive --times --modify-window=2 --progress --verbose --itemize-changes --stats --human-readable "$1" "$2" } +# Disambiguation function for ROS_MASTER_URI/GAZEBO_MASTER_URI +# sets the values to calculated expr 11340+$1 and 11350+$1 respectively +disambig() { + if [ "$#" -ne 1 ]; then + printf "Usage: disambig \n\tSets the ROS_MASTER_URI and GAZEBO_MASTER_URI to 11340+ and 11350+ respectively to allow for parallel simulations" + return + fi + export ROS_MASTER_URI="http://localhost:$((11340 + $1))" + export GAZEBO_MASTER_URI="http://localhost:$((11350 + $1))" + echo "ROS_MASTER_URI=$ROS_MASTER_URI" + echo "GAZEBO_MASTER_URI=$GAZEBO_MASTER_URI" +} + mount_ssd() { sudo mkdir -p /mnt/ssd sudo mount -t exfat /dev/sda1 /mnt/ssd