Skip to content

Commit

Permalink
[#381] Merge branch 'dev' into nos3#381-rw-checkout-application
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincbruce committed Dec 18, 2024
2 parents e51bf53 + 9e643f4 commit 455ad27
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cfg/nos3-mission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<!-- Spacecraft 1 Configuration -->
<!-- sc-full-config.xml or sc-minimal-config.xml -->
<sc-1-cfg>sc-full-config.xml</sc-1-cfg>
<sc-1-cfg>sc-minimal-config.xml</sc-1-cfg>

<!-- Spacecraft N Configuration -->
<!-- <sc-N-cfg>sc-minimal-config.xml</sc-N-cfg> -->
Expand Down
3 changes: 3 additions & 0 deletions cfg/sc-full-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@
<tipoff_y>1.0</tipoff_y>
<tipoff_z>-1.0</tipoff_z>
</orbit>
<sim>
<sim_truth_interface>true</sim_truth_interface>
</sim>
</sc-1-config>
11 changes: 7 additions & 4 deletions cfg/sc-minimal-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<enable>false</enable>
</eps>
<fss>
<enable>false</enable>
<enable>true</enable>
</fss>
<gps>
<enable>false</enable>
Expand Down Expand Up @@ -73,8 +73,11 @@
<enable>false</enable>
</gui>
<orbit>
<tipoff_x>0.1</tipoff_x>
<tipoff_y>1.0</tipoff_y>
<tipoff_z>-1.0</tipoff_z>
<tipoff_x>5.0</tipoff_x>
<tipoff_y>-5.0</tipoff_y>
<tipoff_z>5.0</tipoff_z>
</orbit>
<sim>
<sim_truth_interface>false</sim_truth_interface>
</sim>
</sc-1-config>
2 changes: 1 addition & 1 deletion components/generic_adcs
7 changes: 7 additions & 0 deletions scripts/cfg/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
sc_orbit_tipoff_x = sc_root.find('orbit/tipoff_x').text
sc_orbit_tipoff_y = sc_root.find('orbit/tipoff_y').text
sc_orbit_tipoff_z = sc_root.find('orbit/tipoff_z').text
sc_sim_truth_en = sc_root.find('sim/sim_truth_interface').text

###
### Flight Software - Startup Script
Expand Down Expand Up @@ -311,6 +312,7 @@
st_index = 999
torquer_index = 999
thruster_index = 999
truth_index = 999

with open('./cfg/InOut/Inp_IPC.txt', 'r') as fp:
lines = fp.readlines()
Expand Down Expand Up @@ -360,6 +362,9 @@
if line.find('Thruster IPC') != -1:
if (lines.index(line)) < thruster_index:
thruster_index = lines.index(line) + 1
if line.find('Truth data') != -1:
if (lines.index(line)) < truth_index:
truth_index = lines.index(line) + 1

ipc_off = 'OFF ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)\n'
if (sc_css_en != 'true'):
Expand Down Expand Up @@ -387,6 +392,8 @@
lines[torquer_index] = ipc_off
if (sc_thruster_en != 'true'):
lines[thruster_index] = ipc_off
if (sc_sim_truth_en != 'true'):
lines[truth_index] = ipc_off

with open('./cfg/build/InOut/Inp_IPC.txt', 'w') as fp:
lines = "".join(lines)
Expand Down
5 changes: 5 additions & 0 deletions scripts/cfg/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ echo "Proceeding to optional additions."
echo ""
echo ""

echo "Preparing Shared Folders for Fprime..."
mkdir $USER_FPRIME_PATH 2> /dev/null
echo ""
echo ""

echo "Prepare Igniter (optional)..."
pip3 install pyside6 xmltodict
cd $BASE_DIR
Expand Down
1 change: 1 addition & 0 deletions scripts/cfg/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ yes | rm $BASE_DIR/minicom.cap 2> /dev/null
echo "Cleaning up local user directory..."
$DFLAGS -v $USER_NOS3_DIR:$USER_NOS3_DIR $DBOX rm -rf $USER_NOS3_DIR
rm -rf $USER_NOS3_DIR/*
rm -rf $USER_FPRIME_PATH

yes | rm -rf $USER_NOS3_DIR/.m2 2> /dev/null
yes | rm -rf $USER_NOS3_DIR 2> /dev/null
Expand Down
40 changes: 27 additions & 13 deletions scripts/checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,55 @@ echo ""
# Debugging
# Replace `--tab` with `--window-with-profile=KeepOpen` once you've created this gnome-terminal profile manually

#echo "42..."
#rm -rf $USER_NOS3_DIR/42/NOS3InOut
#cp -r $BASE_DIR/cfg/build/InOut $USER_NOS3_DIR/42/NOS3InOut
#xhost +local:*
#gnome-terminal --tab --title=$SC_NUM" - 42" -- $DFLAGS -e DISPLAY=$DISPLAY -v $USER_NOS3_DIR:$USER_NOS3_DIR -v /tmp/.X11-unix:/tmp/.X11-unix:ro --name $SC_NUM"_fortytwo" -h fortytwo --network=$SC_NETNAME -w $USER_NOS3_DIR/42 -t $DBOX $USER_NOS3_DIR/42/42 NOS3InOut
#echo ""

echo "NOS Core..."
gnome-terminal --tab --title="NOS Engine Server" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_nos_engine_server" -h nos_engine_server --network=$SC_NETNAME -w $SIM_BIN $DBOX /usr/bin/nos_engine_server_standalone -f $SIM_BIN/nos_engine_server_config.json
gnome-terminal --tab --title="NOS Time Driver" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name nos_time_driver --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE time
gnome-terminal --tab --title="NOS Terminal" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name "nos_terminal" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE stdio-terminal
echo ""

echo " Checkout..."
# Rename for your simulator under test to allow checkout, uncomment if already exists

# Example manual build for sample checkout:
##
## HOW TO CHECKOUT
##
# Rename for your simulator under test in this file below to allow checkout, uncomment if already exists
# Change configuration for your selected component (if using 42 for data)
# Modify ./cfg/nos3-mission.xml to use `<sc-1-cfg>sc-minimal-config.xml</sc-1-cfg>`
# Modify ./cfg/sc_minimal-config.xml to enable your specific component to test
# Manually build checkout: (sample shown as reference)
# make debug
# cd ./components/sample/fsw/standalone
# mkdir build
# cd build
# cmake .. -DTGTNAME=cpu1
# make
# exit
# Run `make clean; make; make checkout`
# Double check everything running as expected
# Run tests as needed
# Run `make stop` and repeat until feature complete
echo "Checkout..."

##
## Arducam
##
#gnome-terminal --tab --title="Arducam Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_cam_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE camsim
#gnome-terminal --title="Arducam Checkout" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_arducam_checkout" --network=$SC_NETNAME -w $BASE_DIR $DBOX ./components/arducam/fsw/standalone/build/arducam_checkout

##
## Fine Sun Sensor (FSS)
##
rm -rf $USER_NOS3_DIR/42/NOS3InOut
cp -r $BASE_DIR/cfg/build/InOut $USER_NOS3_DIR/42/NOS3InOut
xhost +local:*
gnome-terminal --tab --title=$SC_NUM" - 42" -- $DFLAGS -e DISPLAY=$DISPLAY -v $USER_NOS3_DIR:$USER_NOS3_DIR -v /tmp/.X11-unix:/tmp/.X11-unix:ro --name $SC_NUM"_fortytwo" -h fortytwo --network=$SC_NETNAME -w $USER_NOS3_DIR/42 -t $DBOX $USER_NOS3_DIR/42/42 NOS3InOut
echo ""
gnome-terminal --tab --title=$SC_NUM" - FSS Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_fss_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_fss_sim
gnome-terminal --title="FSS Checkout" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_fss_checkout" --network=$SC_NETNAME -w $BASE_DIR $DBOX ./components/generic_fss/fsw/standalone/build/generic_fss_checkout

##
## Sample
##
gnome-terminal --tab --title="Sample Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_sample_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE sample_sim
gnome-terminal --title="Sample Checkout" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_sample_checkout" --network=$SC_NETNAME -w $BASE_DIR $DBOX ./components/sample/fsw/standalone/build/sample_checkout
#gnome-terminal --tab --title="Sample Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_sample_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE sample_sim
#gnome-terminal --title="Sample Checkout" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_sample_checkout" --network=$SC_NETNAME -w $BASE_DIR $DBOX ./components/sample/fsw/standalone/build/sample_checkout

# sleep 1
# urlIP=$(docker container inspect sc_1_sample_checkout | grep -i IPAddress | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")
Expand Down
2 changes: 1 addition & 1 deletion scripts/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

mkdir -p $BASE_DIR/fsw/build
$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -v $MVN_DIR:$MVN_DIR -p 8090:8090 -p 5012:5012 -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash
$DFLAGS_CPUS -v $USER_FPRIME_PATH:$USER_FPRIME_PATH -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -v $MVN_DIR:$MVN_DIR -p 8090:8090 -p 5012:5012 -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash
1 change: 1 addition & 0 deletions scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ NUM_CPUS="$( nproc )"

USERDIR=$(cd ~/ && pwd)
USER_NOS3_DIR=$(cd ~/ && pwd)/.nos3
USER_FPRIME_PATH=$USERDIR/.cookiecutter_replay

OPENC3_DIR=$USER_NOS3_DIR/cosmos
OPENC3_PATH=$OPENC3_DIR/openc3.sh
Expand Down

0 comments on commit 455ad27

Please sign in to comment.