Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into nos3#84-fprime-checkout
Browse files Browse the repository at this point in the history
# Conflicts:
#	components/sample
#	scripts/configure.py
#	scripts/prepare.sh
  • Loading branch information
jlucas9 committed Oct 17, 2024
2 parents 27f657d + e5c9d78 commit e4ad6cc
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 25 deletions.
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
Expand Down
2 changes: 1 addition & 1 deletion cfg/InOut/Inp_Graphics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ POS_Z ! Up Axis
FRONT ! Initial POV View (FRONT, FRONT_RIGHT, etc)
******************************* CAM *********************************
"42 Cam" ! Cam Title [delimited by "]
800 800 ! Width, Height [pixels]
600 600 ! Width, Height [pixels]
5.0E-5 ! Mouse Scale Factor
1.8 ! Display's Gamma Exponent (1.8-4.0)
************************** CAM Show Menu ****************************
Expand Down
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
1 change: 1 addition & 0 deletions gsw/ait
Submodule ait added at 478a6c
7 changes: 6 additions & 1 deletion scripts/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@
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 == 'fprime'):
# Copy fprime scripts into ./cfg/build
gsw_identified = 1
os.system('cp ./scripts/gsw_fprime_build.sh ./cfg/build/gsw_build.sh')
os.system('cp ./scripts/gsw_fprime_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
15 changes: 8 additions & 7 deletions scripts/docker_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ $DNETWORK create \
nos3_core
echo ""

#echo "Launch GSW..."
$BASE_DIR/cfg/build/gsw_launch.sh

echo "Launch GSW..."
echo ""
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 +83,8 @@ 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
echo $SC_NUM " - Connect GSW " "${GSW:-cosmos_openc3-operator_1}" " to spacecraft network..."
$DNETWORK connect $SC_NETNAME "${GSW:-cosmos_openc3-operator_1}" --alias cosmos --alias active-gs
echo ""

echo $SC_NUM " - 42..."
Expand All @@ -94,13 +96,12 @@ do

echo $SC_NUM " - Flight Software..."
cd $FSW_DIR
# Debugging
# Replace `--tab` with `--window-with-profile=KeepOpen` once you've created this gnome-terminal profile manually
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 ""

# Debugging
# Replace `--tab` with `--window-with-profile=KeepOpen` once you've created this gnome-terminal profile manually

echo $SC_NUM " - CryptoLib..."
gnome-terminal --tab --title=$SC_NUM" - CryptoLib" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_cryptolib" --network=$SC_NETNAME --network-alias=cryptolib -w $BASE_DIR/gsw/build $DBOX ./support/standalone
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 @@ -23,6 +23,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
13 changes: 13 additions & 0 deletions scripts/gsw_ait_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/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..."
$DCALL image pull ghcr.io/sphinxdefense/gsw-ait:main
$DCALL image pull ghcr.io/sphinxdefense/ttc-command:main
echo ""
24 changes: 24 additions & 0 deletions scripts/gsw_ait_launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/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" -- $DCALL 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"
$DCALL run --rm -d --cpus=$NUM_CPUS -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
$DCALL run --rm -d --cpus=$NUM_CPUS --name ttc-command -p 80:80 --network=nos3_core ghcr.io/sphinxdefense/ttc-command:main
echo ""

pidof firefox > /dev/null
if [ $? -eq 1 ]
then
echo "Firefox launch..."
sleep 3
firefox http://localhost:80 &
echo ""
fi
2 changes: 2 additions & 0 deletions scripts/gsw_cosmos_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts
source $SCRIPT_DIR/env.sh

echo "COSMOS build..."
$DCALL image pull ballaerospace/cosmos:4.5.0
mkdir $GSW_DIR/COMPONENTS 2> /dev/null
rm -r $GSW_DIR/COMPONENTS/* 2> /dev/null
for i in $(find $BASE_DIR/components/ -name "gsw" -type d)
do
#echo "$i"
cp -r $i/* $GSW_DIR/COMPONENTS/
done
echo ""
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
5 changes: 5 additions & 0 deletions scripts/gsw_openc3_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ if [ ! -d $USER_NOS3_DIR ]; then
exit 1
fi

echo "Clone openc3-cosmos into local user directory..."
cd $USER_NOS3_DIR
git clone https://github.com/nasa-itc/openc3-nos3.git --depth 1 -b main $USER_NOS3_DIR/cosmos
echo ""

echo "Prepare openc3-cosmos containers..."
cd $OPENC3_DIR
$OPENC3_PATH run
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
12 changes: 0 additions & 12 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ mkdir $USER_NOS3_DIR/42 2> /dev/null
echo ""
echo ""


echo "Clone openc3-cosmos into local user directory..."
cd $USER_NOS3_DIR
git clone https://github.com/nasa-itc/openc3-nos3.git --depth 1 -b main $USER_NOS3_DIR/cosmos
echo ""
echo ""

echo "Prepare cosmos docker container..."
$DCALL image pull ballaerospace/cosmos:4.5.0
echo ""
echo ""

echo "Prepare nos3 docker container..."
$DCALL image pull $DBOX
echo ""
Expand Down

0 comments on commit e4ad6cc

Please sign in to comment.