From 386e8b7bdb4f1e35152c3c3bf0d70d413676165f Mon Sep 17 00:00:00 2001 From: BradenMeyers Date: Thu, 14 Nov 2024 18:24:25 -0700 Subject: [PATCH 01/43] todo --- setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.sh b/setup.sh index 522b59e..02e3467 100755 --- a/setup.sh +++ b/setup.sh @@ -69,6 +69,7 @@ else sudo apt install -y vim tmux git # Set up volumes + # TODO is there anyway we can setup to not override the current configuration? mkdir bag mkdir config cp -r templates/* config/ From f82bf66f1066b72b1a97da68f082d04c67f4c616 Mon Sep 17 00:00:00 2001 From: bradenMeyers Date: Fri, 15 Nov 2024 16:45:00 -0700 Subject: [PATCH 02/43] FEAT: Setup with workspace env variable There will be some places we can use this --- docker/docker-compose-dev.yaml | 2 +- setup.sh | 33 +++++++++++++++++++++++++++++++++ templates/bash_vars.sh | 4 +++- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose-dev.yaml b/docker/docker-compose-dev.yaml index 6926260..f96a020 100755 --- a/docker/docker-compose-dev.yaml +++ b/docker/docker-compose-dev.yaml @@ -24,7 +24,7 @@ services: - ../cougars-gpio:/home/frostlab/gpio - /etc/localtime:/etc/localtime:ro # Syncs the container's time with the host - /tmp/.X11-unix:/tmp/.X11-unix # Required for GUI applications - command: /bin/bash + command: /bin/bash stdin_open: true # Equivalent to -it in docker run tty: true # Equivalent to -it in docker run restart: always # Optional: Keeps the container running after exit unless you want it to be removed like with --rm \ No newline at end of file diff --git a/setup.sh b/setup.sh index 522b59e..a49b6c1 100755 --- a/setup.sh +++ b/setup.sh @@ -17,6 +17,17 @@ function printWarning { function printError { echo -e "\033[0m\033[31m[ERROR] $1\033[0m" } +function printSuccess { + echo -e "\033[0m\033[32m[SUCCESS] $1\033[0m" +} + +function printFailure { + echo -e "\033[0m\033[31m[FAIL] $1\033[0m" +} + +printWarning "This script should be run in the CoUGARS directory" + +#TODO make this script so that it can have a case that just runs the setup of the config if [ "$(uname -m)" == "aarch64" ]; then @@ -81,7 +92,29 @@ else git clone https://github.com/BYU-FRoSt-Lab/cougars-teensy.git git clone https://github.com/BYU-FRoSt-Lab/cougars-gpio.git git clone https://github.com/BYU-FRoSt-Lab/cougars-docs.git + git clone https://github.com/BYU-FRoSt-Lab/cougars_base_station.git + +fi +current_dir=$(pwd) +source_file="$current_dir/config/bash_vars.sh" + +# Ensure the config directory exists +mkdir -p "$current_dir/config" + +if ! grep -q "export COUG_WORKSPACE_DIR=" "$source_file"; then + echo "export COUG_WORKSPACE_DIR=\"$current_dir\"" >> "$source_file" + printSuccess "Added export statement to $source_file" +else + printInfo "Bash variable statement already exists in $source_file" +fi + +# Append the source command to .bashrc +if ! grep -q "source $source_file" ~/.bashrc; then + echo "source $source_file" >> ~/.bashrc + printSuccess "Added CoUGARS workspace bash variables to .bashrc" +else + printInfo "CoUGARS workspace bash variables already exists in .bashrc" fi printWarning "Make sure to update the vehicle-specific configuration files in "config" now" diff --git a/templates/bash_vars.sh b/templates/bash_vars.sh index 8dd504c..2d7d7d8 100755 --- a/templates/bash_vars.sh +++ b/templates/bash_vars.sh @@ -11,4 +11,6 @@ export VEHICLE_PARAMS_FILE=/home/frostlab/config/vehicle_params.yaml # ex. /home export GPIO_CHIP=/dev/gpiochip0 # ex. /dev/gpiochip0 # Run "ifconfig eth0 | grep 'inet ' | awk '{print $2}'" from OUTSIDE THE DOCKER CONTAINER and copy that number (ex. "192.168.194.59") here -export STATIC_IP=0 \ No newline at end of file +export STATIC_IP=0 + +# Workspace directory of CoUGARS repository Should be sent to the local file when run on setup From 8906b776e85e34dd2c819c13f051b97fe93e77d6 Mon Sep 17 00:00:00 2001 From: Matthew McMurray Date: Mon, 18 Nov 2024 10:41:30 -0700 Subject: [PATCH 03/43] test --- cougars_base_station | 1 + setup.sh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 160000 cougars_base_station diff --git a/cougars_base_station b/cougars_base_station new file mode 160000 index 0000000..144880e --- /dev/null +++ b/cougars_base_station @@ -0,0 +1 @@ +Subproject commit 144880ea1a3690f291e28dc75dda53d151265bab diff --git a/setup.sh b/setup.sh index a49b6c1..b0d467e 100755 --- a/setup.sh +++ b/setup.sh @@ -88,11 +88,11 @@ else sudo ln -s config/local/.tmux.conf ~/.tmux.conf # Copy repos from GitHub - git clone https://github.com/BYU-FRoSt-Lab/cougars-ros2.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-teensy.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-gpio.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-docs.git - git clone https://github.com/BYU-FRoSt-Lab/cougars_base_station.git + git clone git@github.com:BYU-FRoSt-Lab/cougars-ros2.git + git clone git@github.com:BYU-FRoSt-Lab/cougars-teensy.git + git clone git@github.com:BYU-FRoSt-Lab/cougars-gpio.git + git clone git@github.com:BYU-FRoSt-Lab/cougars-docs.git + git clone git@github.com:BYU-FRoSt-Lab/cougars_base_station.git fi From b52606ee53d3b50cf978c015b63af0d96b923ad6 Mon Sep 17 00:00:00 2001 From: Matthew McMurray Date: Mon, 18 Nov 2024 10:42:42 -0700 Subject: [PATCH 04/43] test --- test.file | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.file diff --git a/test.file b/test.file new file mode 100644 index 0000000..e69de29 From 9ef54e23af3a352a5b6c4b824435915c8381a9ea Mon Sep 17 00:00:00 2001 From: Matthew McMurray Date: Mon, 18 Nov 2024 10:43:15 -0700 Subject: [PATCH 05/43] delete test --- test.file | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test.file diff --git a/test.file b/test.file deleted file mode 100644 index e69de29..0000000 From f1f323b004b5df5453235f017b3077e6abd4e3a1 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Wed, 20 Nov 2024 09:16:37 -0700 Subject: [PATCH 06/43] added ssh script to CoUGARs --- coug_ssh.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 coug_ssh.sh diff --git a/coug_ssh.sh b/coug_ssh.sh new file mode 100644 index 0000000..6d8b08c --- /dev/null +++ b/coug_ssh.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# Created by Brighton Anderson, NOV 2024 + +# Make sure the router is powered on before running this script + +# Check if sshpass is installed, and install it if it isn't +if ! command -v sshpass &> /dev/null; then + echo "sshpass could not be found, installing..." + sudo apt update + sudo apt install -y sshpass +fi + +# Define device variables +declare -A DEVICES=( + [1]="coug1.local" + [2]="coug2.local" + [3]="coug3.local" + [4]="coug4.local" + [5]="coug5.local" +) + +# Define username and password +declare -A CREDENTIALS=( + [1]="frostlab:frostlab" + [2]="frostlab:frostlab" + [3]="frostlab:frostlab" + [4]="frostlab:frostlab" + [5]="frostlab:frostlab" +) + +# Function to display menu +display_menu() { + echo "Select a device to SSH into:" + echo "1. Coug1" + echo "2. Coug2" + echo "3. Coug3" + echo "4. Coug4" + echo "5. Coug5" + echo "Enter your choice (1-5):" +} + +# Main script +# Display the menu +display_menu + +# Read user input +read -r choice + +# Validate input +if [[ ! "$choice" =~ ^[1-5]$ ]]; then + echo "Invalid input. Please enter a number between 1 and 5." + exit 1 +fi + +# Split credentials +IFS=':' read -r USERNAME PASSWORD <<< "${CREDENTIALS[$choice]}" + +# Get the selected device IP +DEVICE_IP="${DEVICES[$choice]}" + +# Define the command to execute +COMMAND="bash -i" + +# Connect to the selected device +echo "Connecting to ${DEVICE_IP}..." +sshpass -p "$PASSWORD" ssh -t -o StrictHostKeyChecking=no "$USERNAME@$DEVICE_IP" "$COMMAND" \ No newline at end of file From f1232e2802d7a36a705a8c2361bce77317504eb1 Mon Sep 17 00:00:00 2001 From: ClaytonSmith314 Date: Wed, 20 Nov 2024 09:30:59 -0700 Subject: [PATCH 07/43] fix --- cougars_base_station | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cougars_base_station b/cougars_base_station index 144880e..c0e99d8 160000 --- a/cougars_base_station +++ b/cougars_base_station @@ -1 +1 @@ -Subproject commit 144880ea1a3690f291e28dc75dda53d151265bab +Subproject commit c0e99d8042ce00774b422de62848094d60e5d6c6 From bb6000df67605b7ec7ae179a7380434f25893036 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Wed, 20 Nov 2024 11:17:21 -0700 Subject: [PATCH 08/43] added to tmux.sh to include all mission prereqs --- tmux.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tmux.sh b/tmux.sh index 21b473a..fcd21ca 100755 --- a/tmux.sh +++ b/tmux.sh @@ -45,13 +45,26 @@ case $1 in tmux send-keys -t cougars:0.3 "bash compose.sh" ENTER tmux send-keys -t cougars:0.3 "clear" ENTER + # + tmux send-keys -t cougars:0.0 "cd ~/gpio" ENTER + tmux send-keys -t cougars:0.0 "bash permission_fix.sh" ENTER + tmux send-keys -t cougars:0.0 "cd ~/ros2_ws/dvl_tools" ENTER + tmux send-keys -t cougars:0.0 "bash calibrate_gyro.sh" ENTER tmux send-keys -t cougars:0.0 "cd ~/ros2_ws" ENTER + tmux send-keys -t cougars:0.0 "colcon build" ENTER + tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER + tmux send-keys -t cougars:0.0 "date" ENTER tmux send-keys -t cougars:0.0 "ls" ENTER - tmux send-keys -t cougars:0.0 "bash launch.sh" # Don't start just yet + tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet + tmux send-keys -t cougars:0.1 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:0.1 "bash test.sh" # Don't start just yet + tmux send-keys -t cougars:0.1 "colcon build" ENTER + tmux send-keys -t cougars:0.1 "bash test.sh " # Don't start just yet + tmux send-keys -t cougars:0.2 "cd ~/ros2_ws" ENTER + tmux send-keys -t cougars:0.2 "colcon build" ENTER tmux send-keys -t cougars:0.2 "bash record.sh" # Don't start just yet + tmux send-keys -t cougars:0.3 "cd ~/config" ENTER tmux send-keys -t cougars:0.3 "cat vehicle_params.yaml" ENTER @@ -63,3 +76,10 @@ case $1 in tmux attach-session -t cougars ;; esac + + +#TODO: - figure out how to edit vehicle_params and moos.bhv for the mission +# - talk with matthew about what moos stuff needs to be included before the pAntler timeout command +# - check with Braden, and Nelson to see if everything else is good to go +# - how to implement plot juggler +# - see if any other commands need to be added to the tmux script from new map waypoint stuff \ No newline at end of file From 6eef4d4294a8dae0f76659d7c45303b60e232676 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Wed, 20 Nov 2024 14:44:31 -0700 Subject: [PATCH 09/43] edits to ssh and tmux --- coug_ssh.sh | 4 +++- tmux.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/coug_ssh.sh b/coug_ssh.sh index 6d8b08c..497f9c7 100644 --- a/coug_ssh.sh +++ b/coug_ssh.sh @@ -59,7 +59,9 @@ IFS=':' read -r USERNAME PASSWORD <<< "${CREDENTIALS[$choice]}" DEVICE_IP="${DEVICES[$choice]}" # Define the command to execute -COMMAND="bash -i" +COMMAND="cd ~/CoUGARs + bash -i" + # Connect to the selected device echo "Connecting to ${DEVICE_IP}..." diff --git a/tmux.sh b/tmux.sh index fcd21ca..749aa05 100755 --- a/tmux.sh +++ b/tmux.sh @@ -52,7 +52,7 @@ case $1 in tmux send-keys -t cougars:0.0 "bash calibrate_gyro.sh" ENTER tmux send-keys -t cougars:0.0 "cd ~/ros2_ws" ENTER tmux send-keys -t cougars:0.0 "colcon build" ENTER - tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER + tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER #correct spot to put this? tmux send-keys -t cougars:0.0 "date" ENTER tmux send-keys -t cougars:0.0 "ls" ENTER tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet @@ -79,7 +79,7 @@ esac #TODO: - figure out how to edit vehicle_params and moos.bhv for the mission -# - talk with matthew about what moos stuff needs to be included before the pAntler timeout command +# - add in the mission_deploy.sh the pAntler timeout command # - check with Braden, and Nelson to see if everything else is good to go # - how to implement plot juggler # - see if any other commands need to be added to the tmux script from new map waypoint stuff \ No newline at end of file From ded13e2900154eac5693cf61d87dbf6dd30cfb0a Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Wed, 20 Nov 2024 15:18:13 -0700 Subject: [PATCH 10/43] edits to tmux --- tmux.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tmux.sh b/tmux.sh index 749aa05..2c472e7 100755 --- a/tmux.sh +++ b/tmux.sh @@ -33,6 +33,8 @@ case $1 in tmux split-window -v -t cougars tmux select-pane -t cougars:0.0 tmux split-window -v -t cougars + tmux select-pane -t cougars:0.2 + tmux split-window -h -t cougars tmux select-pane -t cougars:0.0 # Send commands to the tmux session @@ -44,6 +46,11 @@ case $1 in tmux send-keys -t cougars:0.2 "clear" ENTER tmux send-keys -t cougars:0.3 "bash compose.sh" ENTER tmux send-keys -t cougars:0.3 "clear" ENTER + # tmux send-keys -t cougars:0.4 "bash compose.sh" ENTER + # tmux send-keys -t cougars:0.4 "clear" ENTER + + + # tmux send-keys -t cougars:0.0 "cd ~/gpio" ENTER @@ -59,6 +66,8 @@ case $1 in tmux send-keys -t cougars:0.1 "cd ~/ros2_ws" ENTER tmux send-keys -t cougars:0.1 "colcon build" ENTER + tmux send-keys -t cougars:0.1 "cd ~/ros2_ws/moos_tools" ENTER + tmux send-keys -t cougars:0.1 "bash mission_deploy.sh" # is this the best place for mission_deploy? tmux send-keys -t cougars:0.1 "bash test.sh " # Don't start just yet tmux send-keys -t cougars:0.2 "cd ~/ros2_ws" ENTER @@ -68,6 +77,10 @@ case $1 in tmux send-keys -t cougars:0.3 "cd ~/config" ENTER tmux send-keys -t cougars:0.3 "cat vehicle_params.yaml" ENTER + # tmux send-keys -t cougars:0.4 "cd ~/ros2_ws/moos_tools" ENTER + # tmux send-keys -t cougars:0.4 "bash mission_start.sh" # Don't start just yet + tmux new-window -t cougars -n moos_mission_start 'bash ~/ros2_ws/moos_tools/mission_start.sh' # New window or split terminal again? + else printInfo "Attaching to the tmux session..." fi From 31f8afc8d9186a9de38651123f7973adee957600 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Wed, 20 Nov 2024 15:27:14 -0700 Subject: [PATCH 11/43] you can now launch everything before sshing into the coug --- coug_ssh.sh => coug_launch_mission.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename coug_ssh.sh => coug_launch_mission.sh (98%) diff --git a/coug_ssh.sh b/coug_launch_mission.sh similarity index 98% rename from coug_ssh.sh rename to coug_launch_mission.sh index 497f9c7..2d0c757 100644 --- a/coug_ssh.sh +++ b/coug_launch_mission.sh @@ -60,7 +60,7 @@ DEVICE_IP="${DEVICES[$choice]}" # Define the command to execute COMMAND="cd ~/CoUGARs - bash -i" + bash tmux.sh -i" # Connect to the selected device From 76a239e366e3270aad646c00b7d818feb463ffe1 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Wed, 20 Nov 2024 15:47:59 -0700 Subject: [PATCH 12/43] made a moos dedicated window --- tmux.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tmux.sh b/tmux.sh index 2c472e7..e9290d3 100755 --- a/tmux.sh +++ b/tmux.sh @@ -55,23 +55,21 @@ case $1 in # tmux send-keys -t cougars:0.0 "cd ~/gpio" ENTER tmux send-keys -t cougars:0.0 "bash permission_fix.sh" ENTER - tmux send-keys -t cougars:0.0 "cd ~/ros2_ws/dvl_tools" ENTER - tmux send-keys -t cougars:0.0 "bash calibrate_gyro.sh" ENTER - tmux send-keys -t cougars:0.0 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:0.0 "colcon build" ENTER + # tmux send-keys -t cougars:0.0 "cd ~/ros2_ws/dvl_tools" ENTER + # tmux send-keys -t cougars:0.0 "bash calibrate_gyro.sh" ENTER + # tmux send-keys -t cougars:0.0 "cd ~/ros2_ws" ENTER + # tmux send-keys -t cougars:0.0 "colcon build" ENTER tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER #correct spot to put this? tmux send-keys -t cougars:0.0 "date" ENTER tmux send-keys -t cougars:0.0 "ls" ENTER tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet tmux send-keys -t cougars:0.1 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:0.1 "colcon build" ENTER - tmux send-keys -t cougars:0.1 "cd ~/ros2_ws/moos_tools" ENTER - tmux send-keys -t cougars:0.1 "bash mission_deploy.sh" # is this the best place for mission_deploy? + # tmux send-keys -t cougars:0.1 "colcon build" ENTER tmux send-keys -t cougars:0.1 "bash test.sh " # Don't start just yet tmux send-keys -t cougars:0.2 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:0.2 "colcon build" ENTER + # tmux send-keys -t cougars:0.2 "colcon build" ENTER tmux send-keys -t cougars:0.2 "bash record.sh" # Don't start just yet tmux send-keys -t cougars:0.3 "cd ~/config" ENTER @@ -79,7 +77,12 @@ case $1 in # tmux send-keys -t cougars:0.4 "cd ~/ros2_ws/moos_tools" ENTER # tmux send-keys -t cougars:0.4 "bash mission_start.sh" # Don't start just yet - tmux new-window -t cougars -n moos_mission_start 'bash ~/ros2_ws/moos_tools/mission_start.sh' # New window or split terminal again? + tmux new-window -t cougars -n moos 'bash ~/ros2_ws/moos_tools/mission_start.sh' # New window or split terminal again? + tmux split-window -v -t moos + tmux select-pane -t moos:0.1 + tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" ENTER + tmux send-keys -t moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER + else printInfo "Attaching to the tmux session..." From ed529bdbf346a43fb52c79f50aadb464436769ad Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 15:49:52 -0700 Subject: [PATCH 13/43] Fix for git tracking --- .gitignore | 3 ++- cougars_base_station | 1 - setup.sh | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) delete mode 160000 cougars_base_station diff --git a/.gitignore b/.gitignore index 14027d8..8267f81 100755 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ config cougars-ros2 cougars-teensy cougars-gpio -cougars-docs \ No newline at end of file +cougars-docs +cougars_base_station \ No newline at end of file diff --git a/cougars_base_station b/cougars_base_station deleted file mode 160000 index c0e99d8..0000000 --- a/cougars_base_station +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c0e99d8042ce00774b422de62848094d60e5d6c6 diff --git a/setup.sh b/setup.sh index b0d467e..a49b6c1 100755 --- a/setup.sh +++ b/setup.sh @@ -88,11 +88,11 @@ else sudo ln -s config/local/.tmux.conf ~/.tmux.conf # Copy repos from GitHub - git clone git@github.com:BYU-FRoSt-Lab/cougars-ros2.git - git clone git@github.com:BYU-FRoSt-Lab/cougars-teensy.git - git clone git@github.com:BYU-FRoSt-Lab/cougars-gpio.git - git clone git@github.com:BYU-FRoSt-Lab/cougars-docs.git - git clone git@github.com:BYU-FRoSt-Lab/cougars_base_station.git + git clone https://github.com/BYU-FRoSt-Lab/cougars-ros2.git + git clone https://github.com/BYU-FRoSt-Lab/cougars-teensy.git + git clone https://github.com/BYU-FRoSt-Lab/cougars-gpio.git + git clone https://github.com/BYU-FRoSt-Lab/cougars-docs.git + git clone https://github.com/BYU-FRoSt-Lab/cougars_base_station.git fi From d2fc357f0c53124e4d34f11f1dc8dae83defe7aa Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 16:08:52 -0700 Subject: [PATCH 14/43] Updates to documentation, renamed to cougars-base-station --- .gitignore | 1 + compose.sh | 2 ++ coug_ssh.sh | 66 ---------------------------------- docker/docker-compose-dev.yaml | 2 ++ setup.sh | 29 ++++++--------- update.sh | 17 +++++++++ 6 files changed, 32 insertions(+), 85 deletions(-) delete mode 100644 coug_ssh.sh diff --git a/.gitignore b/.gitignore index 8267f81..f56ebec 100755 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ cougars-ros2 cougars-teensy cougars-gpio cougars-docs +cougars-base-station cougars_base_station \ No newline at end of file diff --git a/compose.sh b/compose.sh index 4f77be4..d8a19c0 100755 --- a/compose.sh +++ b/compose.sh @@ -19,6 +19,8 @@ function printError { echo -e "\033[0m\033[31m[ERROR] $1\033[0m" } +printWarning "This script should be run from the root of the CoUGARS directory" + case $1 in "down") # Check the system architecture diff --git a/coug_ssh.sh b/coug_ssh.sh deleted file mode 100644 index 6d8b08c..0000000 --- a/coug_ssh.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# Created by Brighton Anderson, NOV 2024 - -# Make sure the router is powered on before running this script - -# Check if sshpass is installed, and install it if it isn't -if ! command -v sshpass &> /dev/null; then - echo "sshpass could not be found, installing..." - sudo apt update - sudo apt install -y sshpass -fi - -# Define device variables -declare -A DEVICES=( - [1]="coug1.local" - [2]="coug2.local" - [3]="coug3.local" - [4]="coug4.local" - [5]="coug5.local" -) - -# Define username and password -declare -A CREDENTIALS=( - [1]="frostlab:frostlab" - [2]="frostlab:frostlab" - [3]="frostlab:frostlab" - [4]="frostlab:frostlab" - [5]="frostlab:frostlab" -) - -# Function to display menu -display_menu() { - echo "Select a device to SSH into:" - echo "1. Coug1" - echo "2. Coug2" - echo "3. Coug3" - echo "4. Coug4" - echo "5. Coug5" - echo "Enter your choice (1-5):" -} - -# Main script -# Display the menu -display_menu - -# Read user input -read -r choice - -# Validate input -if [[ ! "$choice" =~ ^[1-5]$ ]]; then - echo "Invalid input. Please enter a number between 1 and 5." - exit 1 -fi - -# Split credentials -IFS=':' read -r USERNAME PASSWORD <<< "${CREDENTIALS[$choice]}" - -# Get the selected device IP -DEVICE_IP="${DEVICES[$choice]}" - -# Define the command to execute -COMMAND="bash -i" - -# Connect to the selected device -echo "Connecting to ${DEVICE_IP}..." -sshpass -p "$PASSWORD" ssh -t -o StrictHostKeyChecking=no "$USERNAME@$DEVICE_IP" "$COMMAND" \ No newline at end of file diff --git a/docker/docker-compose-dev.yaml b/docker/docker-compose-dev.yaml index f96a020..d118783 100755 --- a/docker/docker-compose-dev.yaml +++ b/docker/docker-compose-dev.yaml @@ -22,6 +22,8 @@ services: - ../cougars-ros2:/home/frostlab/ros2_ws - ../cougars-teensy:/home/frostlab/teensy_ws - ../cougars-gpio:/home/frostlab/gpio + - ../cougars-docs:/home/frostlab/docs + - ../cougars-base-station:/home/frostlab/base_station - /etc/localtime:/etc/localtime:ro # Syncs the container's time with the host - /tmp/.X11-unix:/tmp/.X11-unix # Required for GUI applications command: /bin/bash diff --git a/setup.sh b/setup.sh index a49b6c1..9104c5b 100755 --- a/setup.sh +++ b/setup.sh @@ -17,17 +17,8 @@ function printWarning { function printError { echo -e "\033[0m\033[31m[ERROR] $1\033[0m" } -function printSuccess { - echo -e "\033[0m\033[32m[SUCCESS] $1\033[0m" -} - -function printFailure { - echo -e "\033[0m\033[31m[FAIL] $1\033[0m" -} -printWarning "This script should be run in the CoUGARS directory" - -#TODO make this script so that it can have a case that just runs the setup of the config +printWarning "This script should be run from the root of the CoUGARS directory" if [ "$(uname -m)" == "aarch64" ]; then @@ -92,29 +83,29 @@ else git clone https://github.com/BYU-FRoSt-Lab/cougars-teensy.git git clone https://github.com/BYU-FRoSt-Lab/cougars-gpio.git git clone https://github.com/BYU-FRoSt-Lab/cougars-docs.git - git clone https://github.com/BYU-FRoSt-Lab/cougars_base_station.git + git clone https://github.com/BYU-FRoSt-Lab/cougars-base-station.git fi +### Record the directory location and set up bash variable sourcing ### + current_dir=$(pwd) source_file="$current_dir/config/bash_vars.sh" -# Ensure the config directory exists -mkdir -p "$current_dir/config" - +# Attempt to add the current workspace directory to the source file if ! grep -q "export COUG_WORKSPACE_DIR=" "$source_file"; then echo "export COUG_WORKSPACE_DIR=\"$current_dir\"" >> "$source_file" - printSuccess "Added export statement to $source_file" + printInfo "Saved the CoUGARs workspace path to $source_file" else - printInfo "Bash variable statement already exists in $source_file" + printWarning "The CoUGARs workspace path already exists in $source_file" fi -# Append the source command to .bashrc +# Attempt to add the source file to the local user's .bashrc if ! grep -q "source $source_file" ~/.bashrc; then echo "source $source_file" >> ~/.bashrc - printSuccess "Added CoUGARS workspace bash variables to .bashrc" + printInfo "Added automatic sourcing of bash variables to .bashrc" else - printInfo "CoUGARS workspace bash variables already exists in .bashrc" + printWarning "Automatic sourcing of bash variables is already set up in .bashrc" fi printWarning "Make sure to update the vehicle-specific configuration files in "config" now" diff --git a/update.sh b/update.sh index 84f85b1..e07b36d 100755 --- a/update.sh +++ b/update.sh @@ -4,6 +4,20 @@ # Simply pulls all avaliable updates # - Make sure you run this from the root of the top-level repo +function printInfo { + echo -e "\033[0m\033[36m[INFO] $1\033[0m" +} + +function printWarning { + echo -e "\033[0m\033[33m[WARNING] $1\033[0m" +} + +function printError { + echo -e "\033[0m\033[31m[ERROR] $1\033[0m" +} + +printWarning "This script should be run from the root of the CoUGARS directory" + # Docker updates docker pull frostlab/cougars:latest @@ -21,3 +35,6 @@ git pull cd ../cougars-docs git pull + +cd ../cougars-base-station +git pull From 7792c3a4d9ebcaa400aff6b526e8b899b9c627a2 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:02:54 -0700 Subject: [PATCH 15/43] Lots of changes to setup, added bash sourcing to docker image --- docker/Dockerfile | 2 + setup.sh | 129 ++++++++++++++++++++++++++--------------- templates/bash_vars.sh | 3 +- 3 files changed, 86 insertions(+), 48 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f713f7c..9e3b027 100755 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -196,3 +196,5 @@ RUN echo "export PATH=$PATH:/home/${LABNAME}/.local/bin:/home/${LABNAME}/moos-iv USER root RUN apt update && apt upgrade -y USER ${LABNAME} + +RUN echo "source /home/${LABNAME}/config/bash_vars.sh" >> ~/.bashrc diff --git a/setup.sh b/setup.sh index 9104c5b..666ee6e 100755 --- a/setup.sh +++ b/setup.sh @@ -22,6 +22,8 @@ printWarning "This script should be run from the root of the CoUGARS directory" if [ "$(uname -m)" == "aarch64" ]; then + ### START RT-SPECIFIC SETUP ### + printInfo "Setting up CoUGARs on a Raspberry Pi 5" # Install Docker if not already installed @@ -39,73 +41,106 @@ if [ "$(uname -m)" == "aarch64" ]; then sudo apt upgrade -y sudo apt install -y vim tmux chrony git mosh - # Set up volumes - mkdir bag - mkdir config - cp -r templates/* config/ - - # Set up udev rules - sudo ln -s config/local/00-teensy.rules /etc/udev/rules.d/00-teensy.rules - sudo udevadm control --reload-rules - sudo udevadm trigger - - # Quick GPIO permission fix (one of the two should work) - sudo chmod 777 /dev/gpiochip4 - sudo chmod 777 /dev/gpiochip0 - - # Set up config files - sudo ln -s config/local/chrony.conf /etc/chrony/chrony.conf - sudo ln -s config/local/.tmux.conf ~/.tmux.conf - - # Copy repos from GitHub - git clone https://github.com/BYU-FRoSt-Lab/cougars-ros2.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-teensy.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-gpio.git + ### END RT-SPECIFIC SETUP ### else + ### START DEV-SPECIFIC SETUP ### + printInfo "Setting up CoUGARs on a development machine" # Install dependencies sudo apt update - sudo apt install -y vim tmux git + sudo apt install -y vim tmux git mosh - # Set up volumes - mkdir bag - mkdir config - cp -r templates/* config/ + ### END DEV-SPECIFIC SETUP ### - # Set up config files - sudo ln -s config/local/.tmux.conf ~/.tmux.conf +fi - # Copy repos from GitHub - git clone https://github.com/BYU-FRoSt-Lab/cougars-ros2.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-teensy.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-gpio.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-docs.git - git clone https://github.com/BYU-FRoSt-Lab/cougars-base-station.git +# Install dependencies +sudo apt update +sudo apt upgrade -y +sudo apt install -y vim tmux chrony git mosh + +# Set up bag directory +if [ -d "bag" ]; then + printWarning "The bag directory already exists" +else + mkdir bag +fi + +# Set up config directory +if [ -d "config" ]; then + printWarning "The config directory already exists -- skipping copying templates" +else + mkdir config + cp -r templates/* config/ +fi +# Set up tmux config file +if [ -f ~/.tmux.conf ]; then + printWarning "The tmux config symlink already exists" +else + sudo ln -s config/local/.tmux.conf ~/.tmux.conf fi -### Record the directory location and set up bash variable sourcing ### +if [ "$(uname -m)" == "aarch64" ]; then + + ### START RT-SPECIFIC SETUP ### -current_dir=$(pwd) -source_file="$current_dir/config/bash_vars.sh" + # Set up chrony config file + if [ -f /etc/chrony/chrony.conf ]; then + printWarning "The chrony config symlink already exists" + else + sudo ln -s config/local/chrony.conf /etc/chrony/chrony.conf + fi + + # Set up udev rules + if [ -f /etc/udev/rules.d/00-teensy.rules ]; then + printWarning "The udev rules symlink already exists" + else + sudo ln -s config/local/00-teensy.rules /etc/udev/rules.d/00-teensy.rules + sudo udevadm control --reload-rules + sudo udevadm trigger + fi -# Attempt to add the current workspace directory to the source file -if ! grep -q "export COUG_WORKSPACE_DIR=" "$source_file"; then - echo "export COUG_WORKSPACE_DIR=\"$current_dir\"" >> "$source_file" + ### END RT-SPECIFIC SETUP ### + +else + + ### START DEV-SPECIFIC SETUP ### + + # Get the CoUGARs workspace location on the development machine + current_dir=$(pwd) + source_file=$current_dir/config/bash_vars.sh + + # Attempt to add the current workspace directory to the source file + if ! grep -q "COUG_WORKSPACE_DIR" $source_file; then + echo "export COUG_WORKSPACE_DIR=$current_dir" >> $source_file printInfo "Saved the CoUGARs workspace path to $source_file" -else + else printWarning "The CoUGARs workspace path already exists in $source_file" -fi + fi -# Attempt to add the source file to the local user's .bashrc -if ! grep -q "source $source_file" ~/.bashrc; then + # Attempt to add the source file to the local user's .bashrc + if ! grep -q "source $source_file" ~/.bashrc; then echo "source $source_file" >> ~/.bashrc printInfo "Added automatic sourcing of bash variables to .bashrc" -else + else printWarning "Automatic sourcing of bash variables is already set up in .bashrc" + fi + + # Copy repos from GitHub + git clone https://github.com/BYU-FRoSt-Lab/cougars-docs.git + git clone https://github.com/BYU-FRoSt-Lab/cougars-base-station.git + + ### END DEV-SPECIFIC SETUP ### + fi -printWarning "Make sure to update the vehicle-specific configuration files in "config" now" +# Copy repos from GitHub +git clone https://github.com/BYU-FRoSt-Lab/cougars-ros2.git +git clone https://github.com/BYU-FRoSt-Lab/cougars-teensy.git +git clone https://github.com/BYU-FRoSt-Lab/cougars-gpio.git + +printInfo "Make sure to update the vehicle-specific configuration files in "config" now" diff --git a/templates/bash_vars.sh b/templates/bash_vars.sh index 2d7d7d8..4f73e5c 100755 --- a/templates/bash_vars.sh +++ b/templates/bash_vars.sh @@ -13,4 +13,5 @@ export GPIO_CHIP=/dev/gpiochip0 # ex. /dev/gpiochip0 # Run "ifconfig eth0 | grep 'inet ' | awk '{print $2}'" from OUTSIDE THE DOCKER CONTAINER and copy that number (ex. "192.168.194.59") here export STATIC_IP=0 -# Workspace directory of CoUGARS repository Should be sent to the local file when run on setup +# Workspace directory of CoUGARS repository on a development machine +# This should be automatically set by 'setup.sh' to the root of the CoUGARS repository if not running on a CougUV From 3acd05b01f20881a17a2dfa8215905e30918a495 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:07:46 -0700 Subject: [PATCH 16/43] More changes to the setup file --- setup.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 666ee6e..0f59efc 100755 --- a/setup.sh +++ b/setup.sh @@ -36,7 +36,7 @@ if [ "$(uname -m)" == "aarch64" ]; then printWarning "Docker is already installed" fi - # Install dependencies + # Update and install dependencies sudo apt update sudo apt upgrade -y sudo apt install -y vim tmux chrony git mosh @@ -50,18 +50,12 @@ else printInfo "Setting up CoUGARs on a development machine" # Install dependencies - sudo apt update sudo apt install -y vim tmux git mosh ### END DEV-SPECIFIC SETUP ### fi -# Install dependencies -sudo apt update -sudo apt upgrade -y -sudo apt install -y vim tmux chrony git mosh - # Set up bag directory if [ -d "bag" ]; then printWarning "The bag directory already exists" From 2ae60eadc533d96fbf18d6474c58ab0c95dafb3e Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:09:32 -0700 Subject: [PATCH 17/43] Documentation updates --- setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 0f59efc..646f3d4 100755 --- a/setup.sh +++ b/setup.sh @@ -25,6 +25,10 @@ if [ "$(uname -m)" == "aarch64" ]; then ### START RT-SPECIFIC SETUP ### printInfo "Setting up CoUGARs on a Raspberry Pi 5" + + # Update and upgrade the system + sudo apt update + sudo apt upgrade -y # Install Docker if not already installed if ! [ -x "$(command -v docker)" ]; then @@ -36,9 +40,7 @@ if [ "$(uname -m)" == "aarch64" ]; then printWarning "Docker is already installed" fi - # Update and install dependencies - sudo apt update - sudo apt upgrade -y + # Install dependencies sudo apt install -y vim tmux chrony git mosh ### END RT-SPECIFIC SETUP ### From e7703570c0e034a7b352d33094aaa046f4f63b2c Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:15:53 -0700 Subject: [PATCH 18/43] Changed from chip 4 to chip 0 --- templates/gpio_def.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/gpio_def.py b/templates/gpio_def.py index 50a5ef7..bfd4c3c 100755 --- a/templates/gpio_def.py +++ b/templates/gpio_def.py @@ -13,4 +13,4 @@ STROBE_PIN = 15 # 15 STROBE_RATE = 1 # seconds -GPIO_CHIP = '/dev/gpiochip4' # ex. '/dev/gpiochip4' +GPIO_CHIP = '/dev/gpiochip0' # ex. '/dev/gpiochip0' From fa17cffb4db0e1044b56b386113e0a2665d0c75b Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:43:37 -0700 Subject: [PATCH 19/43] Permission fix updates --- compose.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compose.sh b/compose.sh index d8a19c0..6e0de18 100755 --- a/compose.sh +++ b/compose.sh @@ -19,6 +19,8 @@ function printError { echo -e "\033[0m\033[31m[ERROR] $1\033[0m" } +source config/bash_vars.sh + printWarning "This script should be run from the root of the CoUGARS directory" case $1 in @@ -41,6 +43,7 @@ case $1 in printInfo "Loading the development image..." docker compose -f docker/docker-compose-dev.yaml up -d fi + docker exec --user root cougars bash -c "bash /home/frostlab/gpio/permission_fix.sh $GPIO_CHIP" docker exec -it cougars bash ;; esac From 3f702b1ed90a448d49051d734e3dc3aacfe7f215 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:44:21 -0700 Subject: [PATCH 20/43] Documentation updates --- compose.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/compose.sh b/compose.sh index 6e0de18..2db035a 100755 --- a/compose.sh +++ b/compose.sh @@ -43,6 +43,7 @@ case $1 in printInfo "Loading the development image..." docker compose -f docker/docker-compose-dev.yaml up -d fi + # Quick permission fix for GPIO access in the container docker exec --user root cougars bash -c "bash /home/frostlab/gpio/permission_fix.sh $GPIO_CHIP" docker exec -it cougars bash ;; From 9d8caa0c82022cdf0a60c1b3fc838a715dd67a65 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:45:36 -0700 Subject: [PATCH 21/43] Documentation updates --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9e3b027..7d6250a 100755 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -197,4 +197,5 @@ USER root RUN apt update && apt upgrade -y USER ${LABNAME} +# Set up bash variable sourcing (Make sure this exists as a volume when you run the container!) RUN echo "source /home/${LABNAME}/config/bash_vars.sh" >> ~/.bashrc From 1ba1bfbc52f92c46d4775351eed9eb7722cca593 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 17:47:12 -0700 Subject: [PATCH 22/43] Documentation updates --- setup.sh | 1 + templates/bash_vars.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/setup.sh b/setup.sh index 646f3d4..4dc8b40 100755 --- a/setup.sh +++ b/setup.sh @@ -106,6 +106,7 @@ else ### START DEV-SPECIFIC SETUP ### + # TODO: Maybe not needed if we do all the work in the Docker image? # Get the CoUGARs workspace location on the development machine current_dir=$(pwd) source_file=$current_dir/config/bash_vars.sh diff --git a/templates/bash_vars.sh b/templates/bash_vars.sh index 4f73e5c..86f9943 100755 --- a/templates/bash_vars.sh +++ b/templates/bash_vars.sh @@ -13,5 +13,6 @@ export GPIO_CHIP=/dev/gpiochip0 # ex. /dev/gpiochip0 # Run "ifconfig eth0 | grep 'inet ' | awk '{print $2}'" from OUTSIDE THE DOCKER CONTAINER and copy that number (ex. "192.168.194.59") here export STATIC_IP=0 +# TODO: Maybe not needed if we do all the work in the Docker image? # Workspace directory of CoUGARS repository on a development machine # This should be automatically set by 'setup.sh' to the root of the CoUGARS repository if not running on a CougUV From f5dff0faf16fe55910231ebe1ef9321cc805c0f5 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 18:06:26 -0700 Subject: [PATCH 23/43] Fixed extra git pulls --- update.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/update.sh b/update.sh index e07b36d..e094527 100755 --- a/update.sh +++ b/update.sh @@ -33,8 +33,12 @@ git pull cd ../cougars-gpio git pull -cd ../cougars-docs -git pull +if [ ! "$(uname -m)" == "aarch64" ]; then -cd ../cougars-base-station -git pull + cd ../cougars-docs + git pull + + cd ../cougars-base-station + git pull + +fi From b6a8e3badcb59ea1dda87b1938eee746e338ea04 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 18:09:08 -0700 Subject: [PATCH 24/43] Documentation updates --- templates/sim_params.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/sim_params.yaml b/templates/sim_params.yaml index 5f3c072..539b652 100755 --- a/templates/sim_params.yaml +++ b/templates/sim_params.yaml @@ -6,7 +6,7 @@ /**: ros__parameters: - water_salinity_ppt: 0.0 # 0 for fresh water, 35 for salt water + water_salinity_ppt: 0.0 # 0.0 for fresh water, 35.0 for salt water magnetic_declination: 10.7 # E is positive, W is negative, 10.70° E for Utah Lake # https://www.ngdc.noaa.gov/geomag/calculators/magcalc.shtml? From d03fa19e2040116b67df0b07602a35ea0b93c2be Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 18:11:26 -0700 Subject: [PATCH 25/43] Code cleanup --- compose.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compose.sh b/compose.sh index 2db035a..c8a04b6 100755 --- a/compose.sh +++ b/compose.sh @@ -43,8 +43,10 @@ case $1 in printInfo "Loading the development image..." docker compose -f docker/docker-compose-dev.yaml up -d fi + # Quick permission fix for GPIO access in the container docker exec --user root cougars bash -c "bash /home/frostlab/gpio/permission_fix.sh $GPIO_CHIP" + docker exec -it cougars bash ;; esac From 59e745ce46e5579cbe5a94ad0f620fbf91cb6b28 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 18:13:02 -0700 Subject: [PATCH 26/43] Code cleanup --- compose.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compose.sh b/compose.sh index c8a04b6..1dcaa33 100755 --- a/compose.sh +++ b/compose.sh @@ -7,6 +7,8 @@ # - This can also be used to open a new bash terminal in an already running container # - Make sure you run this from the root of the top-level repo +source config/bash_vars.sh + function printInfo { echo -e "\033[0m\033[36m[INFO] $1\033[0m" } @@ -19,8 +21,6 @@ function printError { echo -e "\033[0m\033[31m[ERROR] $1\033[0m" } -source config/bash_vars.sh - printWarning "This script should be run from the root of the CoUGARS directory" case $1 in @@ -46,7 +46,7 @@ case $1 in # Quick permission fix for GPIO access in the container docker exec --user root cougars bash -c "bash /home/frostlab/gpio/permission_fix.sh $GPIO_CHIP" - + docker exec -it cougars bash ;; esac From 03942f564c9fe4d5007b490daf944bc23a218d66 Mon Sep 17 00:00:00 2001 From: Nelson Durrant Date: Wed, 20 Nov 2024 18:13:49 -0700 Subject: [PATCH 27/43] Code cleanup --- compose.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose.sh b/compose.sh index 1dcaa33..95c86a9 100755 --- a/compose.sh +++ b/compose.sh @@ -48,5 +48,5 @@ case $1 in docker exec --user root cougars bash -c "bash /home/frostlab/gpio/permission_fix.sh $GPIO_CHIP" docker exec -it cougars bash - ;; + ;; esac From daa61417601b07dd37fc204f72d13090b49c2562 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 09:17:25 -0700 Subject: [PATCH 28/43] added pAntler timeout --- tmux.sh | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/tmux.sh b/tmux.sh index e9290d3..dd7cc97 100755 --- a/tmux.sh +++ b/tmux.sh @@ -27,14 +27,14 @@ case $1 in printInfo "Starting the tmux session..." + ### FIRST WINDOW - ROS SCRIPTS ### + # Start the tmux session tmux new-session -d -s cougars tmux split-window -h -t cougars tmux split-window -v -t cougars tmux select-pane -t cougars:0.0 tmux split-window -v -t cougars - tmux select-pane -t cougars:0.2 - tmux split-window -h -t cougars tmux select-pane -t cougars:0.0 # Send commands to the tmux session @@ -46,42 +46,32 @@ case $1 in tmux send-keys -t cougars:0.2 "clear" ENTER tmux send-keys -t cougars:0.3 "bash compose.sh" ENTER tmux send-keys -t cougars:0.3 "clear" ENTER - # tmux send-keys -t cougars:0.4 "bash compose.sh" ENTER - # tmux send-keys -t cougars:0.4 "clear" ENTER - - - - - # - tmux send-keys -t cougars:0.0 "cd ~/gpio" ENTER - tmux send-keys -t cougars:0.0 "bash permission_fix.sh" ENTER - # tmux send-keys -t cougars:0.0 "cd ~/ros2_ws/dvl_tools" ENTER - # tmux send-keys -t cougars:0.0 "bash calibrate_gyro.sh" ENTER - # tmux send-keys -t cougars:0.0 "cd ~/ros2_ws" ENTER - # tmux send-keys -t cougars:0.0 "colcon build" ENTER - tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER #correct spot to put this? + + tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER tmux send-keys -t cougars:0.0 "date" ENTER - tmux send-keys -t cougars:0.0 "ls" ENTER - tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet + tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet tmux send-keys -t cougars:0.1 "cd ~/ros2_ws" ENTER - # tmux send-keys -t cougars:0.1 "colcon build" ENTER - tmux send-keys -t cougars:0.1 "bash test.sh " # Don't start just yet + tmux send-keys -t cougars:0.1 "bash test.sh " # Don't start just yet tmux send-keys -t cougars:0.2 "cd ~/ros2_ws" ENTER - # tmux send-keys -t cougars:0.2 "colcon build" ENTER - tmux send-keys -t cougars:0.2 "bash record.sh" # Don't start just yet + tmux send-keys -t cougars:0.2 "bash record.sh " # Don't start just yet tmux send-keys -t cougars:0.3 "cd ~/config" ENTER tmux send-keys -t cougars:0.3 "cat vehicle_params.yaml" ENTER - # tmux send-keys -t cougars:0.4 "cd ~/ros2_ws/moos_tools" ENTER - # tmux send-keys -t cougars:0.4 "bash mission_start.sh" # Don't start just yet + ### SECOND WINDOW - MOOS SCRIPTS ### + tmux new-window -t cougars -n moos 'bash ~/ros2_ws/moos_tools/mission_start.sh' # New window or split terminal again? tmux split-window -v -t moos tmux select-pane -t moos:0.1 + tmux split-window -h -t moos tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" ENTER tmux send-keys -t moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER + tmux send-keys -t moos:0.2 "pAntler timeout 5 " # Don't start just yet + + # TODO: Add more terminals, etc + # I bet Matthew has some good ideas else @@ -93,9 +83,10 @@ case $1 in ;; esac +# I added some comments -Nelson -#TODO: - figure out how to edit vehicle_params and moos.bhv for the mission -# - add in the mission_deploy.sh the pAntler timeout command +#TODO: - figure out how to edit vehicle_params and moos.bhv for the mission (I think just cat the file so we can see it in the terminal, and we can change it using vim if needed) +# - add in the mission_deploy.sh the pAntler timeout command ('timeout 5 ' should work -- number is in seconds) # - check with Braden, and Nelson to see if everything else is good to go # - how to implement plot juggler # - see if any other commands need to be added to the tmux script from new map waypoint stuff \ No newline at end of file From 057404eafba2481a9d8cbc28d41394d424bf0967 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:05:12 -0700 Subject: [PATCH 29/43] edits --- tmux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.sh b/tmux.sh index dd7cc97..5709c48 100755 --- a/tmux.sh +++ b/tmux.sh @@ -62,7 +62,7 @@ case $1 in ### SECOND WINDOW - MOOS SCRIPTS ### - tmux new-window -t cougars -n moos 'bash ~/ros2_ws/moos_tools/mission_start.sh' # New window or split terminal again? + tmux new-window -t cougars -n moos 'cd ~/ros2_ws/moos_tools' # New window or split terminal again? tmux split-window -v -t moos tmux select-pane -t moos:0.1 tmux split-window -h -t moos From 5b7d9059ae7a95cc2891e1d992cfe663d9854f03 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:08:17 -0700 Subject: [PATCH 30/43] edits to moos window --- tmux.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux.sh b/tmux.sh index 5709c48..055dded 100755 --- a/tmux.sh +++ b/tmux.sh @@ -62,7 +62,7 @@ case $1 in ### SECOND WINDOW - MOOS SCRIPTS ### - tmux new-window -t cougars -n moos 'cd ~/ros2_ws/moos_tools' # New window or split terminal again? + tmux new-window -n "moos" # New window or split terminal again? tmux split-window -v -t moos tmux select-pane -t moos:0.1 tmux split-window -h -t moos @@ -72,7 +72,7 @@ case $1 in # TODO: Add more terminals, etc # I bet Matthew has some good ideas - +tmux new-window -n "My New Window" else printInfo "Attaching to the tmux session..." From b64865f870731330b226e4790c0fa241f02d9bf9 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:10:45 -0700 Subject: [PATCH 31/43] fix tmux --- tmux.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tmux.sh b/tmux.sh index 055dded..d56e5d2 100755 --- a/tmux.sh +++ b/tmux.sh @@ -66,9 +66,11 @@ case $1 in tmux split-window -v -t moos tmux select-pane -t moos:0.1 tmux split-window -h -t moos - tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" ENTER tmux send-keys -t moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER - tmux send-keys -t moos:0.2 "pAntler timeout 5 " # Don't start just yet + tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet + + tmux send-keys -t moos:0.2 "cd ~/ros2_ws/moos_tools" ENTER + tmux send-keys -t moos:0.2 "timeout 5s pAntler coug.moos" # Don't start just yet # TODO: Add more terminals, etc # I bet Matthew has some good ideas From ebb39cbca3f97bf49122a293b1b55de74707265c Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:14:01 -0700 Subject: [PATCH 32/43] fix --- tmux.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tmux.sh b/tmux.sh index d56e5d2..359231f 100755 --- a/tmux.sh +++ b/tmux.sh @@ -74,7 +74,6 @@ case $1 in # TODO: Add more terminals, etc # I bet Matthew has some good ideas -tmux new-window -n "My New Window" else printInfo "Attaching to the tmux session..." From 66cb8bfd304c56869a2ad47b53e789fcb84f0885 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:16:15 -0700 Subject: [PATCH 33/43] restart chrony outside container --- tmux.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tmux.sh b/tmux.sh index 359231f..f67fd77 100755 --- a/tmux.sh +++ b/tmux.sh @@ -38,6 +38,8 @@ case $1 in tmux select-pane -t cougars:0.0 # Send commands to the tmux session + tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER + tmux send-keys -t cougars:0.0 "date" ENTER tmux send-keys -t cougars:0.0 "bash compose.sh" ENTER tmux send-keys -t cougars:0.0 "clear" ENTER tmux send-keys -t cougars:0.1 "bash compose.sh" ENTER @@ -47,8 +49,8 @@ case $1 in tmux send-keys -t cougars:0.3 "bash compose.sh" ENTER tmux send-keys -t cougars:0.3 "clear" ENTER - tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER - tmux send-keys -t cougars:0.0 "date" ENTER + + tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet tmux send-keys -t cougars:0.1 "cd ~/ros2_ws" ENTER From 6290069d6214fbadb1f8483e13e964726994f083 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:20:44 -0700 Subject: [PATCH 34/43] edits --- tmux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.sh b/tmux.sh index f67fd77..e8946a6 100755 --- a/tmux.sh +++ b/tmux.sh @@ -38,7 +38,7 @@ case $1 in tmux select-pane -t cougars:0.0 # Send commands to the tmux session - tmux send-keys -t cougars:0.0 "sudo systemctl restart chrony" ENTER + tmux send-keys -t cougars:0.0 "echo -e "frostlab\n" | sudo systemctl restart chrony" ENTER tmux send-keys -t cougars:0.0 "date" ENTER tmux send-keys -t cougars:0.0 "bash compose.sh" ENTER tmux send-keys -t cougars:0.0 "clear" ENTER From d3c34a774f353c02c015ddc277d9baafe72ce8ac Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:22:56 -0700 Subject: [PATCH 35/43] edits --- tmux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.sh b/tmux.sh index e8946a6..9b410c8 100755 --- a/tmux.sh +++ b/tmux.sh @@ -38,7 +38,7 @@ case $1 in tmux select-pane -t cougars:0.0 # Send commands to the tmux session - tmux send-keys -t cougars:0.0 "echo -e "frostlab\n" | sudo systemctl restart chrony" ENTER + tmux send-keys -t cougars:0.0 "echo -e "frostlab" | sudo systemctl restart chrony" ENTER tmux send-keys -t cougars:0.0 "date" ENTER tmux send-keys -t cougars:0.0 "bash compose.sh" ENTER tmux send-keys -t cougars:0.0 "clear" ENTER From a503f046cd1ff35437a3ab2c23cb93c6347dc42b Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 10:28:29 -0700 Subject: [PATCH 36/43] test --- tmux.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tmux.sh b/tmux.sh index 9b410c8..e436d52 100755 --- a/tmux.sh +++ b/tmux.sh @@ -38,8 +38,8 @@ case $1 in tmux select-pane -t cougars:0.0 # Send commands to the tmux session - tmux send-keys -t cougars:0.0 "echo -e "frostlab" | sudo systemctl restart chrony" ENTER - tmux send-keys -t cougars:0.0 "date" ENTER + # tmux send-keys -t cougars:0.0 "echo -e "frostlab" | sudo systemctl restart chrony" ENTER + tmux send-keys -t cougars:0.0 "bash compose.sh" ENTER tmux send-keys -t cougars:0.0 "clear" ENTER tmux send-keys -t cougars:0.1 "bash compose.sh" ENTER @@ -49,8 +49,8 @@ case $1 in tmux send-keys -t cougars:0.3 "bash compose.sh" ENTER tmux send-keys -t cougars:0.3 "clear" ENTER - - + tmux send-keys -t cougars:0.0 "cd ~/ros2_ws" ENTER + tmux send-keys -t cougars:0.0 "date" ENTER tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet tmux send-keys -t cougars:0.1 "cd ~/ros2_ws" ENTER @@ -68,9 +68,16 @@ case $1 in tmux split-window -v -t moos tmux select-pane -t moos:0.1 tmux split-window -h -t moos + tmux send-keys -t moos:0.0 "bash compose.sh" ENTER + tmux send-keys -t moos:0.0 "clear" ENTER + tmux send-keys -t moos:0.1 "bash compose.sh" ENTER + tmux send-keys -t moos:0.1 "clear" ENTER + tmux send-keys -t moos:0.2 "bash compose.sh" ENTER + tmux send-keys -t moos:0.2 "clear" ENTER tmux send-keys -t moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet + tmux send-keys -t moos:0.2 "cd ~/ros2_ws/moos_tools" ENTER tmux send-keys -t moos:0.2 "timeout 5s pAntler coug.moos" # Don't start just yet From 9a1b444baf2a1182a30760b4fb10d22d95f2d18b Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 14:52:00 -0700 Subject: [PATCH 37/43] testing --- tmux.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tmux.sh b/tmux.sh index e436d52..8d75775 100755 --- a/tmux.sh +++ b/tmux.sh @@ -30,7 +30,7 @@ case $1 in ### FIRST WINDOW - ROS SCRIPTS ### # Start the tmux session - tmux new-session -d -s cougars + tmux new-session -d -s cougars -n "moos" tmux split-window -h -t cougars tmux split-window -v -t cougars tmux select-pane -t cougars:0.0 @@ -64,22 +64,23 @@ case $1 in ### SECOND WINDOW - MOOS SCRIPTS ### - tmux new-window -n "moos" # New window or split terminal again? - tmux split-window -v -t moos - tmux select-pane -t moos:0.1 - tmux split-window -h -t moos - tmux send-keys -t moos:0.0 "bash compose.sh" ENTER - tmux send-keys -t moos:0.0 "clear" ENTER - tmux send-keys -t moos:0.1 "bash compose.sh" ENTER - tmux send-keys -t moos:0.1 "clear" ENTER - tmux send-keys -t moos:0.2 "bash compose.sh" ENTER - tmux send-keys -t moos:0.2 "clear" ENTER - tmux send-keys -t moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER - tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet + # tmux new-window -n "moos" # New window or split terminal again? + # tmux split-window -h -t moos + # tmux select-pane -t moos:0.1 + # tmux split-window -v -t moos + + # tmux send-keys -t moos:0.0 "bash compose.sh" ENTER + # tmux send-keys -t moos:0.0 "clear" ENTER + # tmux send-keys -t moos:0.1 "bash compose.sh" ENTER + # tmux send-keys -t moos:0.1 "clear" ENTER + # tmux send-keys -t moos:0.2 "bash compose.sh" ENTER + # tmux send-keys -t moos:0.2 "clear" ENTER + # tmux send-keys -t moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER + # tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet - tmux send-keys -t moos:0.2 "cd ~/ros2_ws/moos_tools" ENTER - tmux send-keys -t moos:0.2 "timeout 5s pAntler coug.moos" # Don't start just yet + # tmux send-keys -t moos:0.2 "cd ~/ros2_ws/moos_tools" ENTER + # tmux send-keys -t moos:0.2 "timeout 5s pAntler coug.moos" # Don't start just yet # TODO: Add more terminals, etc # I bet Matthew has some good ideas From ba36835c4a1eaf357c721e3cc8a0ca587c5b3306 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 15:02:24 -0700 Subject: [PATCH 38/43] test --- tmux.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tmux.sh b/tmux.sh index 8d75775..4a4a626 100755 --- a/tmux.sh +++ b/tmux.sh @@ -30,7 +30,7 @@ case $1 in ### FIRST WINDOW - ROS SCRIPTS ### # Start the tmux session - tmux new-session -d -s cougars -n "moos" + tmux new-session -d -s cougars -n "coug" tmux split-window -h -t cougars tmux split-window -v -t cougars tmux select-pane -t cougars:0.0 @@ -64,23 +64,23 @@ case $1 in ### SECOND WINDOW - MOOS SCRIPTS ### - # tmux new-window -n "moos" # New window or split terminal again? - # tmux split-window -h -t moos - # tmux select-pane -t moos:0.1 - # tmux split-window -v -t moos - - # tmux send-keys -t moos:0.0 "bash compose.sh" ENTER - # tmux send-keys -t moos:0.0 "clear" ENTER - # tmux send-keys -t moos:0.1 "bash compose.sh" ENTER - # tmux send-keys -t moos:0.1 "clear" ENTER - # tmux send-keys -t moos:0.2 "bash compose.sh" ENTER - # tmux send-keys -t moos:0.2 "clear" ENTER - # tmux send-keys -t moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER - # tmux send-keys -t moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet + tmux new-window -t cougars -n "moos" # New window or split terminal again? + tmux split-window -h -t cougars:moos + tmux select-pane -t cougars:moos:0.1 + tmux split-window -v -t cougars:moos:0.1 + + tmux send-keys -t cougars:moos:0.0 "bash compose.sh" ENTER + tmux send-keys -t cougars:moos:0.0 "clear" ENTER + tmux send-keys -t cougars:moos:0.1 "bash compose.sh" ENTER + tmux send-keys -t cougars:moos:0.1 "clear" ENTER + tmux send-keys -t cougars:moos:0.2 "bash compose.sh" ENTER + tmux send-keys -t cougars:moos:0.2 "clear" ENTER + tmux send-keys -t cougars:moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER + tmux send-keys -t cougars:moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet - # tmux send-keys -t moos:0.2 "cd ~/ros2_ws/moos_tools" ENTER - # tmux send-keys -t moos:0.2 "timeout 5s pAntler coug.moos" # Don't start just yet + tmux send-keys -t cougars:moos:0.2 "cd ~/ros2_ws/moos_tools" ENTER + tmux send-keys -t cougars:moos:0.2 "timeout 5s pAntler coug.moos" # Don't start just yet # TODO: Add more terminals, etc # I bet Matthew has some good ideas From 006652bec999443be78e10558d6e73b7fac62db0 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 15:11:28 -0700 Subject: [PATCH 39/43] testing --- tmux.sh | 64 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tmux.sh b/tmux.sh index 4a4a626..7ee111f 100755 --- a/tmux.sh +++ b/tmux.sh @@ -33,54 +33,54 @@ case $1 in tmux new-session -d -s cougars -n "coug" tmux split-window -h -t cougars tmux split-window -v -t cougars - tmux select-pane -t cougars:0.0 + tmux select-pane -t cougars:coug.0 tmux split-window -v -t cougars - tmux select-pane -t cougars:0.0 + tmux select-pane -t cougars:coug.0 # Send commands to the tmux session # tmux send-keys -t cougars:0.0 "echo -e "frostlab" | sudo systemctl restart chrony" ENTER - tmux send-keys -t cougars:0.0 "bash compose.sh" ENTER - tmux send-keys -t cougars:0.0 "clear" ENTER - tmux send-keys -t cougars:0.1 "bash compose.sh" ENTER - tmux send-keys -t cougars:0.1 "clear" ENTER - tmux send-keys -t cougars:0.2 "bash compose.sh" ENTER - tmux send-keys -t cougars:0.2 "clear" ENTER - tmux send-keys -t cougars:0.3 "bash compose.sh" ENTER - tmux send-keys -t cougars:0.3 "clear" ENTER + tmux send-keys -t cougars:coug.0 "bash compose.sh" ENTER + tmux send-keys -t cougars:coug.0 "clear" ENTER + tmux send-keys -t cougars:coug.1 "bash compose.sh" ENTER + tmux send-keys -t cougars:coug.1 "clear" ENTER + tmux send-keys -t cougars:coug.2 "bash compose.sh" ENTER + tmux send-keys -t cougars:coug.2 "clear" ENTER + tmux send-keys -t cougars:coug.3 "bash compose.sh" ENTER + tmux send-keys -t cougars:coug.3 "clear" ENTER - tmux send-keys -t cougars:0.0 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:0.0 "date" ENTER - tmux send-keys -t cougars:0.0 "bash launch.sh " # Don't start just yet + tmux send-keys -t cougars:coug.0 "cd ~/ros2_ws" ENTER + tmux send-keys -t cougars:coug.0 "date" ENTER + tmux send-keys -t cougars:coug.0 "bash launch.sh " # Don't start just yet - tmux send-keys -t cougars:0.1 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:0.1 "bash test.sh " # Don't start just yet + tmux send-keys -t cougars:coug.1 "cd ~/ros2_ws" ENTER + tmux send-keys -t cougars:coug.1 "bash test.sh " # Don't start just yet - tmux send-keys -t cougars:0.2 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:0.2 "bash record.sh " # Don't start just yet + tmux send-keys -t cougars:coug.2 "cd ~/ros2_ws" ENTER + tmux send-keys -t cougars:coug.2 "bash record.sh " # Don't start just yet - tmux send-keys -t cougars:0.3 "cd ~/config" ENTER - tmux send-keys -t cougars:0.3 "cat vehicle_params.yaml" ENTER + tmux send-keys -t cougars:coug.3 "cd ~/config" ENTER + tmux send-keys -t cougars:coug.3 "cat vehicle_params.yaml" ENTER ### SECOND WINDOW - MOOS SCRIPTS ### tmux new-window -t cougars -n "moos" # New window or split terminal again? tmux split-window -h -t cougars:moos - tmux select-pane -t cougars:moos:0.1 - tmux split-window -v -t cougars:moos:0.1 - - tmux send-keys -t cougars:moos:0.0 "bash compose.sh" ENTER - tmux send-keys -t cougars:moos:0.0 "clear" ENTER - tmux send-keys -t cougars:moos:0.1 "bash compose.sh" ENTER - tmux send-keys -t cougars:moos:0.1 "clear" ENTER - tmux send-keys -t cougars:moos:0.2 "bash compose.sh" ENTER - tmux send-keys -t cougars:moos:0.2 "clear" ENTER - tmux send-keys -t cougars:moos:0.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER - tmux send-keys -t cougars:moos:0.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet + tmux select-pane -t cougars:moos.0 + tmux split-window -v -t cougars:moos.0 + + tmux send-keys -t cougars:moos.0 "bash compose.sh" ENTER + tmux send-keys -t cougars:moos.0 "clear" ENTER + tmux send-keys -t cougars:moos.1 "bash compose.sh" ENTER + tmux send-keys -t cougars:moos.1 "clear" ENTER + tmux send-keys -t cougars:moos.2 "bash compose.sh" ENTER + tmux send-keys -t cougars:moos.2 "clear" ENTER + tmux send-keys -t cougars:moos.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER + tmux send-keys -t cougars:moos.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet - tmux send-keys -t cougars:moos:0.2 "cd ~/ros2_ws/moos_tools" ENTER - tmux send-keys -t cougars:moos:0.2 "timeout 5s pAntler coug.moos" # Don't start just yet + tmux send-keys -t cougars:moos.2 "cd ~/ros2_ws/moos_tools" ENTER + tmux send-keys -t cougars:moos.2 "timeout 5s pAntler coug.moos" # Don't start just yet # TODO: Add more terminals, etc # I bet Matthew has some good ideas From 2acd479ef3d76519ed05f701b3cf6885e46cf6bd Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 15:16:23 -0700 Subject: [PATCH 40/43] testing chrony restart --- tmux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.sh b/tmux.sh index 7ee111f..a59da4c 100755 --- a/tmux.sh +++ b/tmux.sh @@ -38,7 +38,7 @@ case $1 in tmux select-pane -t cougars:coug.0 # Send commands to the tmux session - # tmux send-keys -t cougars:0.0 "echo -e "frostlab" | sudo systemctl restart chrony" ENTER + tmux send-keys -t cougars:coug.0 "echo 'frostlab' | sudo -S systemctl restart chrony" ENTER tmux send-keys -t cougars:coug.0 "bash compose.sh" ENTER tmux send-keys -t cougars:coug.0 "clear" ENTER From c83bc8fff242ce7ecb81f0eb2402647a62cedcae Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 15:19:20 -0700 Subject: [PATCH 41/43] edit --- tmux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.sh b/tmux.sh index a59da4c..fc051c4 100755 --- a/tmux.sh +++ b/tmux.sh @@ -50,7 +50,7 @@ case $1 in tmux send-keys -t cougars:coug.3 "clear" ENTER tmux send-keys -t cougars:coug.0 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:coug.0 "date" ENTER + tmux send-keys -t cougars:coug.0 "date" C-m tmux send-keys -t cougars:coug.0 "bash launch.sh " # Don't start just yet tmux send-keys -t cougars:coug.1 "cd ~/ros2_ws" ENTER From 81afbb644c6eeb41a79e4ca093ec406ff2ab06e7 Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 15:22:07 -0700 Subject: [PATCH 42/43] fixed --- tmux.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux.sh b/tmux.sh index fc051c4..2c071ff 100755 --- a/tmux.sh +++ b/tmux.sh @@ -50,10 +50,10 @@ case $1 in tmux send-keys -t cougars:coug.3 "clear" ENTER tmux send-keys -t cougars:coug.0 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:coug.0 "date" C-m tmux send-keys -t cougars:coug.0 "bash launch.sh " # Don't start just yet tmux send-keys -t cougars:coug.1 "cd ~/ros2_ws" ENTER + tmux send-keys -t cougars:coug.1 "date" ENTER tmux send-keys -t cougars:coug.1 "bash test.sh " # Don't start just yet tmux send-keys -t cougars:coug.2 "cd ~/ros2_ws" ENTER @@ -80,7 +80,7 @@ case $1 in tmux send-keys -t cougars:moos.2 "cd ~/ros2_ws/moos_tools" ENTER - tmux send-keys -t cougars:moos.2 "timeout 5s pAntler coug.moos" # Don't start just yet + tmux send-keys -t cougars:moos.2 "timeout 120s pAntler coug.moos" # Don't start just yet # TODO: Add more terminals, etc # I bet Matthew has some good ideas From edd74f482a29f190b0f40a760f55eebb8db19ede Mon Sep 17 00:00:00 2001 From: Brighton Anderson Date: Thu, 21 Nov 2024 15:27:10 -0700 Subject: [PATCH 43/43] edit --- tmux.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tmux.sh b/tmux.sh index 2c071ff..dc16ea2 100755 --- a/tmux.sh +++ b/tmux.sh @@ -53,7 +53,6 @@ case $1 in tmux send-keys -t cougars:coug.0 "bash launch.sh " # Don't start just yet tmux send-keys -t cougars:coug.1 "cd ~/ros2_ws" ENTER - tmux send-keys -t cougars:coug.1 "date" ENTER tmux send-keys -t cougars:coug.1 "bash test.sh " # Don't start just yet tmux send-keys -t cougars:coug.2 "cd ~/ros2_ws" ENTER @@ -75,6 +74,9 @@ case $1 in tmux send-keys -t cougars:moos.1 "clear" ENTER tmux send-keys -t cougars:moos.2 "bash compose.sh" ENTER tmux send-keys -t cougars:moos.2 "clear" ENTER + + tmux send-keys -t cougars:moos.0 "date" ENTER + tmux send-keys -t cougars:moos.1 "cat ~/ros2_ws/moos_tools/coug.bhv" ENTER tmux send-keys -t cougars:moos.1 "bash ~/ros2_ws/moos_tools/mission_deploy.sh" # Don't start just yet