Skip to content

Commit

Permalink
Checkout virtual iridium repo in CI (#188)
Browse files Browse the repository at this point in the history
* Checkout virtual iridium repo in CI

* Add debug statements

* Add more debug statements

* Migrate run_virtual_iridium script

* Make script executable

---------

Co-authored-by: hhenry01 <[email protected]>
  • Loading branch information
patrick-5546 and hhenry01 authored Nov 4, 2023
1 parent d9d04dc commit 96f0f8b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/actions/checkout/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 20 additions & 0 deletions run_virtual_iridium.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 96f0f8b

Please sign in to comment.