Skip to content

Commit

Permalink
[#403] Organized scripts, updated readme, and renamed doc to docs;
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucas9 committed Nov 1, 2024
1 parent 04bc16a commit 8e7a5eb
Show file tree
Hide file tree
Showing 36 changed files with 52 additions and 283 deletions.
30 changes: 13 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,42 +90,38 @@ clean-gsw:
rm -rf /tmp/nos3

config:
./scripts/config.sh
./scripts/cfg/config.sh

debug:
./scripts/docker_debug.sh

fprime:
./scripts/fprime.sh
./scripts/fsw/fprime.sh

fsw:
./scripts/docker_build_fsw.sh

fsw-launch:
./scripts/launch_fsw.sh

gsw:
./scripts/docker_build_cryptolib.sh
./scripts/gsw/docker_build_cryptolib.sh
./cfg/build/gsw_build.sh

igniter:
./scripts/igniter_launch.sh

launch:
./scripts/docker_launch.sh

log:
./scripts/log.sh

prep:
./scripts/prepare.sh
./scripts/cfg/prepare.sh

prep-gsw:
./scripts/gsw_startup.sh
./scripts/cfg/prep_gsw.sh

prep-sat:
./scripts/sat_startup.sh

real-clean:
$(MAKE) clean
./scripts/real_clean.sh
./scripts/cfg/prep_sat.sh

sim:
./scripts/docker_build_sim.sh
Expand All @@ -138,10 +134,10 @@ start-sat:

stop:
./scripts/docker_stop.sh
./scripts/stop.sh

stop-gsw:
./scripts/stop_gsw.sh
./scripts/gsw/stop_gsw.sh

igniter:
./scripts/igniter_launch.sh
uninstall:
$(MAKE) clean
./scripts/cfg/uninstall.sh
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Will provision a VM with all required packages installed to be used immediately.
3. Clone the submodules `git submodule update --init --recursive`
4. Run `vagrant up` and wait to return to a prompt
- This can take anywhere from a few minutes to hours depending on internet speeds and host PC specs
_It may also be wise at around this stage to shutdown the VM once it starts and to allocate it more resources if possible, preferably at least 4 cores and 8 GB of RAM, preferably 8 cores and 16 GB of RAM._
_It may also be wise at around this stage to shutdown the VM once it starts and to allocate it more resources if possible, preferably 8 cores and 16 GB of RAM._
5. In VirtualBox `Devices > Upgrade Guest Additions...`
- Wait for this to complete
6. Run `vagrant reload` to finish the upgrade
Expand All @@ -43,37 +43,24 @@ By default the nos3 repository is shared into the virtual machine at `/home/jsta
- `make launch`
6. Stop NOS3
- `make stop`
- Note that COSMOS will remaining running in the background until `make stop-gsw` is done
- Note that OpenC3, if in use, will remaining running in the background until `make stop-gsw` is done

To uninstall the hidden directories created, run `make uninstall`.

### Directory Layout
* `cfg` contains the configuration files for the mission and spacecraft
* `components` contains the repositories for the hardware component apps
- /fsw - cFS application
- /gsw - OpenC3 (or Ball Aerospace) COSMOS database
- /sim - NOS3 simulator
- /support - Optional folder containing a standalone checkout application
* `docs` contains various documentation related to the project
* `fsw` contains the repositories needed to build cFS FSW
- /apps - the open source cFS apps
- /cfe - the core flight system (cFS) source files
- /nos3_defs - cFS definitions to configure cFS for NOS3
- /osal - operating system abstraction layer (OSAL), enables building for Linux and flight OS
- /psp - platform support package (PSP), enables use on multiple types of boards
- /tools - standard cFS provided tools
* `gsw` contains the nos3 ground station files, and other ground based tools
- /cosmos - OpenC3 (or Ball Aerospace) COSMOS files
- /OrbitInviewPowerPrediction - OIPP tool for operators
- /scripts - convenience scripts
* `scripts` contains various convenience scripts
* `sims` contains the nos3 simulators and configuration files
- /cfg - 42 configuration files and NOS3 top level configuration files
- /nos_time_driver - time synchronization for all components
- /sim_common - common files used by component simulators including the files that define the simulator plugin architecture
- /sim_terminal - terminal for testing on NOS Engine busses
- /truth_42_sim - interface between 42 and OpenC3 COSMOS to provide dynamics truth data

### Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the tags on this repository.

### License
This project is licensed under the NOSA (NASA Open Source Agreement) License.
This project is licensed under the NOSA 1.3 (NASA Open Source Agreement) License.

# Issues and Features
Please report issues and request features on the GitHub tracking system - [NOS3 Issues](https://www.github.com/nasa/nos3/issues).
Expand Down
2 changes: 1 addition & 1 deletion cfg/nos3_defs/tables/sch_def_schtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ SCH_ScheduleEntry_t SCH_DefaultScheduleTable[SCH_TABLE_ENTRIES] =

/* slot #55 - Component HK */
/*{ SCH_DISABLED, SCH_ACTIVITY_SEND_MSG, 1, 0, 24, SCH_GROUP_MD_WAKEUP }, */ /* MD Wakeup */
{ SCH_ENABLED, SCH_ACTIVITY_SEND_MSG, 1, 0, 65, SCH_GROUP_CFE_HK }, /* EPS HK Request */
{ SCH_ENABLED, SCH_ACTIVITY_SEND_MSG, 5, 4, 65, SCH_GROUP_CFE_HK }, /* EPS HK Request */
{ SCH_UNUSED, 0, 0, 0, 0, SCH_GROUP_NONE},
{ SCH_UNUSED, 0, 0, 0, 0, SCH_GROUP_NONE},
{ SCH_UNUSED, 0, 0, 0, 0, SCH_GROUP_NONE},
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/config.sh → scripts/cfg/config.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh
source $SCRIPT_DIR/../env.sh

# Make flight software configuration directory
mkdir -p $BASE_DIR/cfg/build
Expand All @@ -15,4 +15,4 @@ cp -r $BASE_DIR/cfg/nos3_defs $BASE_DIR/cfg/build/
cp -r $BASE_DIR/cfg/sims $BASE_DIR/cfg/build/

# Configure flight software
python3 $SCRIPT_DIR/configure.py
python3 $SCRIPT_DIR/cfg/configure.py
30 changes: 14 additions & 16 deletions scripts/configure.py → scripts/cfg/configure.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@

if (fsw_cfg == 'fprime'):
fsw_identified = 1
os.system('cp ./scripts/fsw_fprime_build.sh ./cfg/build/fsw_build.sh')
os.system('cp ./scripts/fsw_fprime_launch.sh ./cfg/build/fsw_launch.sh')
os.system('cp ./scripts/fprime.sh ./scripts/docker_launch.sh')
os.system('cp ./scripts/fprime_build_fsw.sh ./scripts/docker_build_fsw.sh')
os.system('cp ./scripts/fsw/fsw_fprime_build.sh ./cfg/build/fsw_build.sh')
os.system('cp ./scripts/fsw/fsw_fprime_launch.sh ./cfg/build/fsw_launch.sh')
os.system('cp ./scripts/fsw/fprime.sh ./scripts/docker_launch.sh')
os.system('cp ./scripts/fsw/fprime_build_fsw.sh ./scripts/docker_build_fsw.sh')

if (fsw_cfg == 'cfs'):
fsw_identified = 1
# os.system('cp ./scripts/fsw_fprime_build.sh ./cfg/build/fsw_build.sh')
# os.system('cp ./scripts/fsw_fprime_launch.sh ./cfg/build/fsw_launch.sh')
os.system('cp ./scripts/cfs_cosmos.sh ./scripts/docker_launch.sh')
os.system('cp ./scripts/cfs_build_fsw.sh ./scripts/docker_build_fsw.sh')
os.system('cp ./scripts/fsw/cfs_cosmos.sh ./scripts/docker_launch.sh')
os.system('cp ./scripts/fsw/cfs_build_fsw.sh ./scripts/docker_build_fsw.sh')

if (fsw_identified == 0):
print('Invalid FSW in configuration file!')
Expand All @@ -50,23 +48,23 @@
if (gsw_cfg == 'openc3'):
# Copy openc3 scripts into ./cfg/build
gsw_identified = 1
os.system('cp ./scripts/gsw_openc3_build.sh ./cfg/build/gsw_build.sh')
os.system('cp ./scripts/gsw_openc3_launch.sh ./cfg/build/gsw_launch.sh')
os.system('cp ./scripts/gsw/gsw_openc3_build.sh ./cfg/build/gsw_build.sh')
os.system('cp ./scripts/gsw/gsw_openc3_launch.sh ./cfg/build/gsw_launch.sh')
if (gsw_cfg == 'cosmos'):
# Copy cosmos scripts into ./cfg/build
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')
os.system('cp ./scripts/gsw/gsw_cosmos_build.sh ./cfg/build/gsw_build.sh')
os.system('cp ./scripts/gsw/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')
os.system('cp ./scripts/gsw/gsw_fprime_build.sh ./cfg/build/gsw_build.sh')
os.system('cp ./scripts/gsw/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')
os.system('cp ./scripts/gsw/gsw_ait_build.sh ./cfg/build/gsw_build.sh')
os.system('cp ./scripts/gsw/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
2 changes: 1 addition & 1 deletion scripts/igniter_launch.sh → scripts/cfg/igniter_launch.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Convenience script for NOS# development

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh
source $SCRIPT_DIR/../env.sh
echo ""
echo ""

Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 2 additions & 11 deletions scripts/prepare.sh → scripts/cfg/prepare.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
#
# Convenience script for NOS3 development
#
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/../env.sh

FLIGHT_SOFTWARE="cFS"

read_xml ()
{
local IFS=\>
read -d \< ENTITY CONTENT
local ret=$?
TAG_NAME=${ENTITY%% *}
ATTRIBUTES=${ENTITY#* }
return $ret
}

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh
Expand Down
6 changes: 3 additions & 3 deletions scripts/real_clean.sh → scripts/cfg/uninstall.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ yes | rm $BASE_DIR/minicom.cap 2> /dev/null
echo "Cleaning up CryptoLib build..."
yes | rm $BASE_DIR/minicom.cap 2> /dev/null

$DCALL system prune -f
$DCALL system prune -f 2> /dev/null

echo "Cleaning up local user directory..."
yes | rm -r $USER_NOS3_DIR 2> /dev/null

echo "Removing superfluous Docker networks and such..."
yes | docker network prune
yes | docker swarm leave --force
yes | docker network prune -f 2> /dev/null
yes | docker swarm leave --force 2> /dev/null

exit 0
32 changes: 0 additions & 32 deletions scripts/docker_compose_launch.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/docker_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ do
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 --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/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
2 changes: 1 addition & 1 deletion scripts/docker_launch_sat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ 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 --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/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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/cfs_cosmos.sh → scripts/fsw/cfs_cosmos.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ do
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 --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/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
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/fprime_build_fsw.sh → scripts/fsw/fprime_build_fsw.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh
source $SCRIPT_DIR/../env.sh

# Check that local NOS3 directory exists
if [ ! -d $USER_NOS3_DIR ]; then
Expand Down
5 changes: 2 additions & 3 deletions scripts/fprime_launch.sh → scripts/fsw/fprime_launch.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh
source $SCRIPT_DIR/../env.sh


cd components/sample/fprime/fprime-nos3/
. fprime-venv/bin/activate
# fprime-util build
fprime-gds --gui-port 5000 --gui-addr 0.0.0.0
fprime-gds --gui-port 5000 --gui-addr 0.0.0.0
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/fsw_respawn.sh → scripts/fsw/fsw_respawn.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh
source $SCRIPT_DIR/../env.sh

#echo "fsw_respawn.sh script"

Expand Down
2 changes: 1 addition & 1 deletion scripts/docker_build_cryptolib.sh → scripts/gsw/docker_build_cryptolib.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh
source $SCRIPT_DIR/../env.sh

# Check that local NOS3 directory exists
if [ ! -d $USER_NOS3_DIR ]; then
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 0 additions & 46 deletions scripts/l0.sh

This file was deleted.

Loading

0 comments on commit 8e7a5eb

Please sign in to comment.