diff --git a/.gitmodules b/.gitmodules index fb53a08b..43f560b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,9 +40,6 @@ [submodule "sims/sim_terminal"] path = sims/sim_terminal url = https://github.com/nasa-itc/sim_terminal.git -[submodule "gsw/ait"] - path = gsw/ait - url = https://github.com/nasa-itc/gsw-ait.git [submodule "gsw/OrbitInviewPowerPrediction"] path = gsw/OrbitInviewPowerPrediction url = https://github.com/nasa-itc/OrbitInviewPowerPrediction.git @@ -131,3 +128,11 @@ path = components/syn url = https://github.com/nasa-itc/syn.git branch = main +[submodule "gsw/ait"] + path = gsw/ait + url = https://github.com/sphinxdefense/gsw-ait.git + branch = main +[submodule "gsw/ttc-command"] + path = gsw/ttc-command + url = https://github.com/sphinxdefense/ttc-command + branch = main diff --git a/cfg/nos3_defs/tables/sc_rts001.c b/cfg/nos3_defs/tables/sc_rts001.c index 2c4ddec3..0614580a 100644 --- a/cfg/nos3_defs/tables/sc_rts001.c +++ b/cfg/nos3_defs/tables/sc_rts001.c @@ -59,7 +59,7 @@ SC_RtsTable001_t SC_Rts001 = { /* 2 - Enable Debug */ .hdr2.TimeTag = 1, .cmd2.CmdHeader = CFE_MSG_CMD_HDR_INIT(TO_LAB_CMD_MID, SC_MEMBER_SIZE(cmd2), TO_LAB_OUTPUT_ENABLE_CC, 0x00), - .cmd2.Payload.dest_IP = "cosmos", + .cmd2.Payload.dest_IP = "active-gs", /* 3 - Enable RTS 3-64 */ .hdr3.TimeTag = 1, diff --git a/gsw/ait b/gsw/ait new file mode 160000 index 00000000..478a6c8a --- /dev/null +++ b/gsw/ait @@ -0,0 +1 @@ +Subproject commit 478a6c8a0adb5066545732ce2b0f927f0be7420f diff --git a/scripts/configure.py b/scripts/configure.py index efd0c737..54b4d053 100755 --- a/scripts/configure.py +++ b/scripts/configure.py @@ -31,6 +31,11 @@ gsw_identified = 1 os.system('cp ./scripts/gsw_cosmos_build.sh ./cfg/build/gsw_build.sh') os.system('cp ./scripts/gsw_cosmos_launch.sh ./cfg/build/gsw_launch.sh') +if (gsw_cfg == 'ait'): + # Copy ait scripts into ./cfg/build + gsw_identified = 1 + os.system('cp ./scripts/gsw_ait_build.sh ./cfg/build/gsw_build.sh') + os.system('cp ./scripts/gsw_ait_launch.sh ./cfg/build/gsw_launch.sh') if (gsw_identified == 0): print('Invalid GSW in configuration file!') print('Exiting due to error...') diff --git a/scripts/docker_launch.sh b/scripts/docker_launch.sh index 5d1caec7..e8f44de2 100755 --- a/scripts/docker_launch.sh +++ b/scripts/docker_launch.sh @@ -50,9 +50,10 @@ $DNETWORK create \ nos3_core echo "" -#echo "Launch GSW..." -$BASE_DIR/cfg/build/gsw_launch.sh -echo "" + +echo "Launch GSW..." +source $BASE_DIR/cfg/build/gsw_launch.sh + echo "Create NOS interfaces..." export GND_CFG_FILE="-f nos3-simulator.xml" @@ -81,8 +82,15 @@ do $DNETWORK create $SC_NETNAME 2> /dev/null echo "" - echo $SC_NUM " - Connect COSMOS to spacecraft network..." - $DNETWORK connect $SC_NETNAME cosmos_openc3-operator_1 --alias cosmos + alias="cosmos" + if [ "${GSW:-cosmos_openc3-operator_1}" == "ait" ]; then + alias="ait" + docker run --rm -d -h influxdb --name influxdb -p 8086:8086 -e INFLUXDB_DB=$INFLUXDB_DB -e INFLUXDB_ADMIN_USER=$INFLUXDB_ADMIN_USER -e INFLUXDB_ADMIN_PASSWORD=$INFLUXDB_ADMIN_PASSWORD --network=nos3_core influxdb:1.8 + docker run --rm -d --name ttc-command -p 80:80 --network=nos3_core ghcr.io/sphinxdefense/ttc-command:main + fi + + echo $SC_NUM " - Connect GSW " "${GSW:-cosmos_openc3-operator_1}" " to spacecraft network..." + $DNETWORK connect $SC_NETNAME "${GSW:-cosmos_openc3-operator_1}" --alias $alias --alias active-gs echo "" echo $SC_NUM " - 42..." @@ -94,6 +102,8 @@ do echo $SC_NUM " - Flight Software..." cd $FSW_DIR + + gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw_respawn.sh & #gnome-terminal --window-with-profile=KeepOpen --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $FSW_DIR/core-cpu1 -R PO & echo "" diff --git a/scripts/docker_stop.sh b/scripts/docker_stop.sh index d8dea64b..3fbad8a2 100755 --- a/scripts/docker_stop.sh +++ b/scripts/docker_stop.sh @@ -18,6 +18,9 @@ rm -rf $BASE_DIR/fsw/build/exe/cpu1/scratch/* cd $SCRIPT_DIR; $DFLAG compose down > /dev/null 2>&1 $DCALL ps --filter=name="sc_*" -aq | xargs $DCALL stop > /dev/null 2>&1 & $DCALL ps --filter=name="nos_*" -aq | xargs $DCALL stop > /dev/null 2>&1 & +$DCALL ps --filter=name="ait*" -aq | xargs $DCALL stop > /dev/null 2>&1 & +$DCALL ps --filter=name="influxdb*" -aq | xargs $DCALL stop > /dev/null 2>&1 & +$DCALL ps --filter=name="ttc-command*" -aq | xargs $DCALL stop > /dev/null 2>&1 & $DCALL ps --filter ancestor="ballaerospace/cosmos:4.5.0" -aq | xargs $DCALL stop > /dev/null 2>&1 & # Intentionally wait to complete diff --git a/scripts/env.sh b/scripts/env.sh index 426d55f9..9a86e587 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -22,6 +22,10 @@ USER_NOS3_DIR=$(cd ~/ && pwd)/.nos3 OPENC3_DIR=$USER_NOS3_DIR/cosmos OPENC3_PATH=$OPENC3_DIR/openc3.sh +INFLUXDB_DB=ait +INFLUXDB_ADMIN_USER=ait +INFLUXDB_ADMIN_PASSWORD=admin_password + ### ### Notes: ### Podman and/or Docker on RHEL not yet supported diff --git a/scripts/gsw_ait_build.sh b/scripts/gsw_ait_build.sh new file mode 100755 index 00000000..acb0dc8f --- /dev/null +++ b/scripts/gsw_ait_build.sh @@ -0,0 +1,10 @@ +#!/bin/bash -i +# +# Convenience script for NOS3 development +# + +CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts +source $SCRIPT_DIR/env.sh + +echo "AIT build..." diff --git a/scripts/gsw_ait_launch.sh b/scripts/gsw_ait_launch.sh new file mode 100755 index 00000000..7158d5d2 --- /dev/null +++ b/scripts/gsw_ait_launch.sh @@ -0,0 +1,12 @@ +#!/bin/bash -i +# +# Convenience script for NOS3 development +# + +CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts +source $SCRIPT_DIR/env.sh +export GSW="ait" + +echo "AIT launch..." +gnome-terminal --tab --title="AIT" -- docker run --rm -it -v $BASE_DIR:$BASE_DIR -v /tmp/nos3:/tmp/nos3 --name ait -h ait -p 8001:8001 --network=nos3_core ghcr.io/sphinxdefense/gsw-ait:main "source ~/.bashrc && ait-server" diff --git a/scripts/gsw_cosmos_launch.sh b/scripts/gsw_cosmos_launch.sh index dcc159b6..9d41b671 100755 --- a/scripts/gsw_cosmos_launch.sh +++ b/scripts/gsw_cosmos_launch.sh @@ -6,6 +6,7 @@ CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts source $SCRIPT_DIR/env.sh +export GSW="cosmos_openc3-operator_1" # Debugging #echo "Script directory = " $SCRIPT_DIR diff --git a/scripts/gsw_openc3_launch.sh b/scripts/gsw_openc3_launch.sh index 6cd6fcf2..11d306a5 100755 --- a/scripts/gsw_openc3_launch.sh +++ b/scripts/gsw_openc3_launch.sh @@ -6,6 +6,7 @@ CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts source $SCRIPT_DIR/env.sh +export GSW="cosmos_openc3-operator_1" # Debugging #echo "Script directory = " $SCRIPT_DIR diff --git a/scripts/prepare.sh b/scripts/prepare.sh index 03371dc6..9356464c 100755 --- a/scripts/prepare.sh +++ b/scripts/prepare.sh @@ -26,6 +26,16 @@ $DCALL image pull ballaerospace/cosmos:4.5.0 echo "" echo "" +echo "Prepare ait docker container..." +$DCALL image pull ghcr.io/sphinxdefense/gsw-ait:main +echo "" +echo "" + +echo "Prepare ttc docker container..." +$DCALL image pull ghcr.io/sphinxdefense/ttc-command:main +echo "" +echo "" + echo "Prepare nos3 docker container..." $DCALL image pull $DBOX echo ""