diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml index c616eeeb1..ad0e28fe2 100644 --- a/.github/actions/checkout/action.yml +++ b/.github/actions/checkout/action.yml @@ -22,3 +22,10 @@ runs: with: repository: UBCSailbot/custom_interfaces path: src/custom_interfaces + + - name: Checkout virtual_iridium repository + if: ${{ inputs.repository != 'sailbot_workspace' && inputs.repository == 'network_systems' }} + uses: actions/checkout@v4 + with: + repository: UBCSailbot/virtual_iridium + path: src/virtual_iridium diff --git a/run_virtual_iridium.sh b/run_virtual_iridium.sh new file mode 100755 index 000000000..e814bfbc5 --- /dev/null +++ b/run_virtual_iridium.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# README under sailbot_workspace/src/network_systems/scripts/ + +WEBHOOK_SERVER_ENDPOINT=${1:-127.0.0.1:8081} +VIRTUAL_IRIDIUM_HTTP_SERVER_PORT=${2:-8080} + +# Make sure everything is killed on exit +trap 'exit' INT TERM +trap 'kill %; exit 0' EXIT + +# Port environment variables are defined in $ROS_WORKSPACE/.devcontainer/base-dev/base-dev.Dockerfile +touch $LOCAL_TRANSCEIVER_TEST_PORT +touch $VIRTUAL_IRIDIUM_PORT + +# Setup socat relay pair +socat -d -d -t 0 pty,raw,echo=0,link=$LOCAL_TRANSCEIVER_TEST_PORT pty,raw,echo=0,link=$VIRTUAL_IRIDIUM_PORT & + +# Run Virtual Iridium +python2 $ROS_WORKSPACE/src/virtual_iridium/python/Iridium9602.py --webhook_server_endpoint $WEBHOOK_SERVER_ENDPOINT \ + --http_server_port $VIRTUAL_IRIDIUM_HTTP_SERVER_PORT -d $VIRTUAL_IRIDIUM_PORT -m HTTP_POST diff --git a/test.sh b/test.sh index c81cce720..b9d234f90 100755 --- a/test.sh +++ b/test.sh @@ -13,7 +13,7 @@ trap 'exit' INT TERM trap 'signal_handler' EXIT if [ -f install/local_setup.bash ]; then source install/local_setup.bash; fi -if [ -d src/network_systems ]; then src/network_systems/scripts/run_virtual_iridium.sh &> /dev/null & fi +if [ -d src/network_systems ]; then ./run_virtual_iridium.sh &> /dev/null & fi colcon test --packages-ignore virtual_iridium --merge-install --event-handlers console_cohesion+ colcon test-result exit 0