Skip to content

Commit

Permalink
Merge pull request #302 from nasa/dev
Browse files Browse the repository at this point in the history
Release Candidate 1.7.0
  • Loading branch information
jlucas9 authored May 14, 2024
2 parents d9a2d9f + 88ad478 commit 983897d
Show file tree
Hide file tree
Showing 132 changed files with 5,393 additions and 1,280 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf

# Handle PNGs as binary
*.png binary
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ build
*.o
support/nos3_install.log
tmp
core.*
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
[submodule "gsw/cosmos"]
path = gsw/cosmos
url = https://github.com/nasa-itc/gsw-cosmos.git
branch = main
[submodule "sims/truth_42_sim"]
path = sims/truth_42_sim
url = https://github.com/nasa-itc/truth_42_sim.git
Expand Down Expand Up @@ -123,3 +124,10 @@
[submodule "components/generic_adcs"]
path = components/generic_adcs
url = https://github.com/nasa-itc/generic_adcs.git
[submodule "components/generic_star_tracker"]
path = components/generic_star_tracker
url = https://github.com/nasa-itc/generic_star_tracker.git
[submodule "components/syn"]
path = components/syn
url = https://github.com/nasa-itc/syn.git
branch = main
92 changes: 47 additions & 45 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
BUILDTYPE ?= debug
INSTALLPREFIX ?= exe
FSWBUILDDIR ?= $(CURDIR)/fsw/build
GSWBUILDDIR ?= $(CURDIR)/gsw/build
SIMBUILDDIR ?= $(CURDIR)/sims/build

export CFS_APP_PATH = ../components
export MISSION_DEFS = ../cfg/build/
export MISSIONCONFIG = ../cfg/build/nos3

# The "prep" step requires extra options that are specified via enviroment variables.
# Certain special ones should be passed via cache (-D) options to CMake.
Expand All @@ -27,94 +30,93 @@ endif

# The "LOCALTGTS" defines the top-level targets that are implemented in this makefile
# Any other target may also be given, in that case it will simply be passed through.
LOCALTGTS := all fsw fsw-prep pack sim sim-prep clean clean-fsw clean-sim checkout gsw gsm-prep launch log real-clean stop sc-launch
LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw
OTHERTGTS := $(filter-out $(LOCALTGTS),$(MAKECMDGOALS))

# As this makefile does not build any real files, treat everything as a PHONY target
# This ensures that the rule gets executed even if a file by that name does exist
.PHONY: $(LOCALTGTS) $(OTHERTGTS)

#
# Generic Commands
# Commands
#
all:
$(MAKE) config
$(MAKE) fsw
$(MAKE) sim
$(MAKE) gsw

#
# FSW
#
fsw:
$(MAKE) fsw-prep
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install
build-cryptolib:
mkdir -p $(GSWBUILDDIR)
cd $(GSWBUILDDIR) && cmake $(PREP_OPTS) -DSUPPORT=1 ../../components/cryptolib
$(MAKE) --no-print-directory -C $(GSWBUILDDIR)

fsw-prep:
build-fsw:
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install

#
# Sims
#
sim:
$(MAKE) sim-prep
$(MAKE) --no-print-directory -C $(SIMBUILDDIR) install

sim-prep:
build-sim:
mkdir -p $(SIMBUILDDIR)
cd $(SIMBUILDDIR) && cmake -DCMAKE_INSTALL_PREFIX=$(SIMBUILDDIR) ..
$(MAKE) --no-print-directory -C $(SIMBUILDDIR) install

#
# GSW
#
gsw:
$(MAKE) gsw-prep
./gsw/scripts/create_cosmos_gem.sh

gsw-prep:
mkdir -p ./gsw/cosmos/build
checkout:
./scripts/docker_checkout.sh

#
# Clean
#
clean:
$(MAKE) clean-fsw
$(MAKE) clean-sim
$(MAKE) clean-gsw
rm -rf cfg/build

clean-fsw:
rm -rf cfg/build/nos3_defs
rm -rf fsw/build

clean-sim:
rm -rf sims/build

clean-gsw:
rm -rf gsw/build
rm -rf gsw/cosmos/build
rm -rf /tmp/nos3

#
# Script Calls
#
checkout:
./gsw/scripts/checkout.sh
config:
./scripts/config.sh

gsw-launch:
./gsw/scripts/gsw.sh
debug:
./scripts/docker_debug.sh

launch:
./gsw/scripts/launch.sh
fsw:
./scripts/docker_build_fsw.sh

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

launch:
./scripts/docker_launch.sh

log:
./gsw/scripts/log.sh
./scripts/log.sh

prep:
./scripts/prepare.sh

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

sc-launch:
./gsw/scripts/sc_launch.sh
sim:
./scripts/docker_build_sim.sh

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

stop-gsw:
./scripts/stop_gsw.sh

igniter:
./scripts/igniter_launch.sh
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,67 @@ The best source of documentation can be found at [the wiki](https://github.com/n

### Prerequisites
Each of the applications listed below are required prior to performing the installation procedure:
* [Git 2.36+](https://git-scm.com/)
* [Vagrant 2.3.4+](https://www.vagrantup.com/)
* [VirtualBox 7.0+](https://www.virtualbox.org/)
* Option A, you already use Linux
* [Git 2.36+](https://git-scm.com/)
* Linux with docker and docker compose installed
* Option B, deployment of a virtual machine (VM)
* [Git 2.36+](https://git-scm.com/)
* [Vagrant 2.3.4+](https://www.vagrantup.com/)
* [VirtualBox 7.0+](https://www.virtualbox.org/)

### Installing
Option B only.
Will provision a VM with all required packages installed to be used immediately.
1. Clone the repository `git clone https://github.com/nasa/nos3.git`
2. `cd nos3`
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
5. Login to the nos3 user using the password `nos3123!` and get to work!
6. Try building and running following the instructions below
_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._
5. In VirtualBox `Devices > Upgrade Guest Additions...`
- Wait for this to complete
6. Run `vagrant reload` to finish the upgrade
7. Login to the jstar user using the password `jstar123!` and get to work!
8. Try building and running following the instructions below

### Getting started
By default the nos3 repository is shared into the virtual machine at `/home/nos3/Desktop/github-nos3`
By default the nos3 repository is shared into the virtual machine at `/home/jstar/Desktop/github-nos3`
1. Open a terminal
2. Navigate to the nos3 repository
- `cd /home/nos3/Desktop/github-nos3`
2. To build use the `make` command from the nos3 repo
3. To run nos3 use the `make launch` command from the nos3 repo
4. To halt nos3 use the `make stop` command from the nos3 repo
- `cd /home/jstar/Desktop/github-nos3`
3. Prepare the environment with COSMOS and docker containers
- `make prep`
4. Build FSW, GSW, and SIMS
- `make`
5. Run NOS3 including FSW, GSW, and SIMS
- `make launch`
6. Stop NOS3
- `make stop`
- Note that COSMOS will remaining running in the background until `make stop-gsw` is done

### Directory Layout
* `components` contains the repositories for the hardware component apps; each repository contains the app, an associated sim, and COSMOS command and telemetry tables
* `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
* `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
- /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
- /ait - Ammos Instrument Toolkit (Untested for 1.05.0)
- /cosmos - COSMOS files
- /cosmos - OpenC3 (or Ball Aerospace) COSMOS files
- /OrbitInviewPowerPrediction - OIPP tool for operators
- /scripts - convenience scripts
* `sims` contains the nos3 simulators and configuration files
- /cfg - 42 configuration files and NOS3 top level configuration files
- /nos_time_driver - time syncronization for all components
- /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 COSMOS to provide dynamics truth data to COSMOS
- /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.
Expand All @@ -59,5 +78,12 @@ This project is licensed under the NOSA (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).

## Contributions
If you would like to contribute to the repository, please complete this [NASA Form][def] and submit it to [email protected] with [email protected] CC'ed.
Next, please create an issue describing the work to be performed noting that you intend to work it, create a related branch, and submit a pull request when ready. When complete, we will review and work to get it integrated.

## Support
If this project interests you or if you have any questions, please feel free to contact any developer directly or email `[email protected]`.


[def]: https://github.com/nasa/nos3/files/14578604/NOS3_Invd_CLA.pdf "NOS3 NASA Contributor Form PDF"
22 changes: 15 additions & 7 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
Vagrant.configure("2") do |config|
###
### Notes:
### Using the provided base boxes is not required to use the software
### Base boxes are provisioned from the following location
### * https://github.com/nasa-itc/deployment
### Links to which commit was used is captured in the box release notes
###

### Uncomment one of the following to select configuration
#config.vm.box = "nos3/rocky"
#config.vm.box = "nos3/rocky" # Not yet updated to support
config.vm.box = "nos3/ubuntu"

### Specify version
config.vm.box_version = "20230731"
config.vm.box_version = "20231101"

### Share host NOS3 repository into VM
config.vm.synced_folder ".", "/home/nos3/Desktop/github-nos3",
owner: 'root', group:'vboxsf', automount:'true',
config.vm.synced_folder ".", "/home/jstar/Desktop/github-nos3",
owner: 'jstar', group:'vboxsf', automount:'true',
mount_options: ["dmode=0770", "fmode=0770"]

### General configuration
config.vm.provider "virtualbox" do |vbox|
vbox.name = "nos3_20230731"
vbox.name = "nos3_20231101"
vbox.gui = true
### Enable additional configuration as needed
vbox.cpus = 6
vbox.memory = "6144"
vbox.cpus = 4
vbox.memory = "8192"
end
end
15 changes: 10 additions & 5 deletions sims/cfg/InOut/Inp_Cmd.txt → cfg/InOut/Inp_Cmd.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<<<<<<<<<<<<<<<<< 42: Command Script File >>>>>>>>>>>>>>>>>
0.0 SC[0] Cmd Angles = [0.0 0.0 0.0] deg, Seq = 123 wrt L Frame
EOF

0.0 SC[0] qrl = [0.0 0.0 0.0 1.0]
1000.0 SC[0] qrl = [0.0 1.0 0.0 0.0]
2000.0 Point SC[0].B[0] Primary Vector [0.0 0.0 1.0] at VELOCITY
2000.0 Point SC[0].B[0] Secondary Vector [1.0 0.0 0.0] at SUN

##############################################################
# All lines after EOF are ignored
# Comment lines begin with #, %, or //
Expand All @@ -19,11 +23,14 @@ EOF

# Sim-related commands
%lf DTSIM = %lf
%lf SC[%ld].RotDOF %s
%lf SC[%ld].DynMethod %s
%lf SC[%ld].G[%ld].RotLocked[%ld] %s
%lf SC[%ld].G[%ld].TrnLocked[%ld] %s
%lf Impart Impulsive Delta-V of [%lf %lf %lf] m/s in Frame %c to Orb[%ld]
%c can be N or L
%lf SC[%ld].LoopGain = %lf
%lf SC[%ld].LoopDelay = %lf
%lf SC[%ld].GainAndDelayActive = %s

# GUI-related commands
%lf POV.Host.SC %ld
Expand All @@ -33,7 +40,7 @@ EOF
%lf Banner = "Banner in Quotes"
%lf GL Output Step = %lf
%lf POV CmdRange = %lf
%lf POV CmdSeq = %li
%lf POV CmdSeq = %ld
%lf POV CmdAngle = [%lf %lf %lf] deg
%lf POV CmdPermute = [%lf %lf %lf; %lf %lf %lf; %lf %lf %lf]
%lf POV TimeToGo = %lf
Expand Down Expand Up @@ -66,8 +73,6 @@ EOF
%lf Align SC[%ld].B[%ld] %s Vector [%lf %lf %lf] with %c-frame Vector [%lf %lf %lf]
# %c-frame can be H, N, or L
%lf Align SC[%ld].B[%ld] %s Vector [%lf %lf %lf] with SC[%ld].B[%ld] vector [%lf %lf %lf]
%lf SC[%ld].Thr[%ld] %s
%s is OFF or ON
Event Eclipse Entry SC[%ld] qrl = [%lf %lf %lf %lf]
Event Eclipse Exit SC[%ld] qrl = [%lf %lf %lf %lf]
Event Eclipse Entry SC[%ld] Cmd Angles = [%lf %lf %lf] deg, Seq = %ld wrt %c Frame
Expand Down
Loading

0 comments on commit 983897d

Please sign in to comment.