Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nasa/nos3#339] AIT Reintegration #363

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -131,6 +128,14 @@
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
[submodule "components/generic_thruster"]
path = components/generic_thruster
url = https://github.com/nasa-itc/generic_thruster.git
2 changes: 1 addition & 1 deletion cfg/nos3_defs/tables/sc_rts001.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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,
Expand Down
2 changes: 1 addition & 1 deletion fsw/apps/sc
Submodule sc updated 1 files
+309 −309 unit-test/sc_cmds_tests.c
2 changes: 1 addition & 1 deletion fsw/psp
1 change: 1 addition & 0 deletions gsw/ait
Submodule ait added at 478a6c
2 changes: 1 addition & 1 deletion gsw/cosmos
5 changes: 5 additions & 0 deletions scripts/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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...')
Expand Down
20 changes: 15 additions & 5 deletions scripts/docker_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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..."
Expand All @@ -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 ""
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions scripts/gsw_ait_build.sh
Original file line number Diff line number Diff line change
@@ -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..."
12 changes: 12 additions & 0 deletions scripts/gsw_ait_launch.sh
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions scripts/gsw_cosmos_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/gsw_openc3_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion sims/nos_time_driver
2 changes: 1 addition & 1 deletion sims/sim_common
Loading