Skip to content

Commit

Permalink
[#298] Merge branch 'dev' into nos3#298 for testing to prep for final PR
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincbruce committed Oct 30, 2024
2 parents af11109 + 32a7034 commit 79c9232
Show file tree
Hide file tree
Showing 82 changed files with 1,255 additions and 397 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build

on:
push:
pull_request:

jobs:
fsw:
runs-on: ubuntu-latest
container:
image: ivvitc/nos3-64:20241010
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Update
run: apt-get update
- name: Install dependencies
run: apt-get install -y python3 docker docker.io
- name: prep
run: make prep
- name: config
run: make config
- name: build directory
run: mkdir ./fsw/build
- name: build
run: make build-fsw

sim:
runs-on: ubuntu-latest
container:
image: ivvitc/nos3-64:20241010
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Update
run: apt-get update
- name: Install dependencies
run: apt-get install -y python3 docker docker.io
- name: prep
run: make prep
- name: config
run: make config
- name: build directory
run: mkdir ./sims/build
- name: build
run: make build-sim
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ core.*
# Misc
#
onair_wireshark_capture.pcapng

.cdskeyfile
.reservedkeyfile
.resetkeyfile

17 changes: 14 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 @@ -141,3 +138,17 @@
path = components/onair/fsw
url = https://github.com/nasa-itc/OnAIR.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
[submodule "fsw/fprime/fprime-nos3"]
path = fsw/fprime/fprime-nos3
url = https://github.com/nasa-itc/fprime-nos3.git
29 changes: 27 additions & 2 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ 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 checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw
LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fprime 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
Expand All @@ -52,17 +52,33 @@ build-cryptolib:
$(MAKE) --no-print-directory -C $(GSWBUILDDIR)

build-fsw:


ifeq ($(FLIGHT_SOFTWARE), fprime)
cd fsw/fprime/fprime-nos3 && fprime-util generate && fprime-util build

endif

ifeq ($(FLIGHT_SOFTWARE), cfs)
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install
else
pwd
endif

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

build-test:
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install

checkout:
./scripts/checkout.sh
./scripts/docker_checkout.sh

clean:
$(MAKE) clean-fsw
Expand All @@ -73,6 +89,9 @@ clean:
clean-fsw:
rm -rf cfg/build/nos3_defs
rm -rf fsw/build
rm -rf fsw/fprime/fprime-nos3/build-artifacts
rm -rf fsw/fprime/fprime-nos3/build-fprime-automatic-native
rm -rf fsw/fprime/fprime-nos3/fprime-venv

clean-sim:
rm -rf sims/build
Expand All @@ -88,6 +107,9 @@ config:
debug:
./scripts/docker_debug.sh

fprime:
./scripts/fprime.sh

fsw:
./scripts/docker_build_fsw.sh

Expand Down Expand Up @@ -118,5 +140,8 @@ stop:
stop-gsw:
./scripts/stop_gsw.sh

test-fsw:
cd $(FSWBUILDDIR)/amd64-posix/default_cpu1 && ctest -O ctest.log

igniter:
./scripts/igniter_launch.sh
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ 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:
* Option A
* Option A, you already use Linux
* [Git 2.36+](https://git-scm.com/)
* Linux with docker and docker compose installed
* Option B
* 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`
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
24 changes: 12 additions & 12 deletions cfg/InOut/Inp_IPC.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<<<<<<<<<<<<<<< 42: InterProcess Comm Configuration File >>>>>>>>>>>>>>>>
17 ! Number of Sockets
********************************** Sample IPC *****************************
TX ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
0 ! AC.ID for ACS mode
"State00.42" ! File name for WRITE or READ
SERVER ! Socket Role (SERVER,CLIENT,GMSEC_CLIENT)
fortytwo 4242 ! Server Host Name, Port
FALSE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
1 ! Number of TX prefixes
"SC" ! Prefix 0
16 ! Number of Sockets
********************************** RW 0 to 42 *****************************
RX ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
0 ! AC.ID for ACS mode
Expand Down Expand Up @@ -80,6 +70,16 @@ FALSE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
1 ! Number of TX prefixes
"SC" ! Prefix 0
********************************** Thruster IPC ****************************
RX ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
1 ! AC.ID for ACS mode
"Thruster.Rx" ! File name for WRITE or READ
SERVER ! Socket Role (SERVER,CLIENT,GMSEC_CLIENT)
fortytwo 4280 ! Server Host Name, Port
FALSE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
1 ! Number of TX prefixes
"SC" ! Prefix 0
********************************** GPS IPC *****************************
TX ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
0 ! AC.ID for ACS mode
Expand Down Expand Up @@ -157,7 +157,7 @@ TX ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE
0 ! AC.ID for ACS mode
"IMU.42" ! File name for WRITE or READ
SERVER ! Socket Role (SERVER,CLIENT,GMSEC_CLIENT)
fortytwo 4280 ! Server Host Name, Port
fortytwo 4281 ! Server Host Name, Port
FALSE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
1 ! Number of TX prefixes
Expand Down
8 changes: 8 additions & 0 deletions cfg/InOut/Nodes_Simple.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<<<<<<<<<<<<<<<< Body Node Inputs for 42 >>>>>>>>>>>>>>>>>>>>>
Simple Nodes ! Description
4 ! Number of Nodes
******************* Node Location, Comment *********************
0.1 -0.4 0.25 "Thrusters"
0.1 -0.1 0.25 "Thrusters"
0.1 -0.4 0.15 "Thrusters"
0.1 -0.1 0.15 "Thrusters"
30 changes: 24 additions & 6 deletions cfg/InOut/SC_NOS3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CM ! Pos of CM or ORIGIN, wrt F
0.0 0.0 0.0 ! Vel wrt Formation (m/s), expressed in F
*************************** Initial Attitude ***************************
NAN ! Ang Vel wrt [NL], Att [QA] wrt [NLF]
0.3 0.4 0.5 ! Ang Vel (deg/sec)
0.0 0.0 0.0 ! Ang Vel (deg/sec)
0.0 0.0 0.0 1.0 ! Quaternion
60.0 40.0 20.0 213 ! Angles (deg) & Euler Sequence
*************************** Dynamics Flags ***************************
Expand All @@ -34,7 +34,7 @@ NONE ! Shaker File Name
0.0 0.0 0.0 ! Constant Embedded Momentum (Nms)
0.0 0.0 0.0 ! Constant Embedded Magnetic Dipole (A-m^2)
stf1_red.obj ! Geometry Input File Name
NONE ! Node File Name
Nodes_Simple.txt ! Node File Name
NONE ! Flex File Name
************************************************************************
*************************** Joint Parameters ***************************
Expand Down Expand Up @@ -99,13 +99,31 @@ NONE ! Drag/Jitter Input File Name
0.0 0.0 1.0 ! MTB Axis Components, [X, Y, Z]
0 ! Flex Node Index
************************* Thruster Parameters **************************
0 ! Number of Thrusters
4 ! Number of Thrusters
============================== Thr 0 =================================
PULSED ! Mode (PULSED or PROPORTIONAL)
1.0 ! Thrust Force (N)
-1.0 0.0 0.0 ! Thrust Axis
PROPORTIONAL ! Mode (PULSED or PROPORTIONAL)
0.01 ! Thrust Force (N)
1.0 0.0 0.0 ! Thrust Axis
0 ! Body
0 ! Node
============================== Thr 1 =================================
PROPORTIONAL ! Mode (PULSED or PROPORTIONAL)
0.01 ! Thrust Force (N)
1.0 0.0 0.0 ! Thrust Axis
0 ! Body
1 ! Node
============================== Thr 2 =================================
PROPORTIONAL ! Mode (PULSED or PROPORTIONAL)
0.01 ! Thrust Force (N)
1.0 0.0 0.0 ! Thrust Axis
0 ! Body
2 ! Node
============================== Thr 3 =================================
PROPORTIONAL ! Mode (PULSED or PROPORTIONAL)
0.01 ! Thrust Force (N)
1.0 0.0 0.0 ! Thrust Axis
0 ! Body
3 ! Node
******************************* Gyro ************************************
3 ! Number of Gyro Axes
============================== Axis 0 ===================================
Expand Down
2 changes: 1 addition & 1 deletion cfg/gui/cfg_gui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def saveText(self, layout:QLayout, config_value:int):

# TODO: change to dynamically pull apps/components from xml file or directory, but how?
applications = ['cf', 'ds', 'fm', 'lc', 'sc']
components = ['adcs', 'cam', 'css', 'eps', 'fss', 'gps', 'imu', 'mag', 'radio', 'rw', 'sample', 'st', 'syn', 'torquer']
components = ['adcs', 'cam', 'css', 'eps', 'fss', 'gps', 'imu', 'mag', 'radio', 'rw', 'sample', 'st', 'syn', 'torquer', 'thruster']

i = 0
while layout.itemAt(i) != None:
Expand Down
26 changes: 21 additions & 5 deletions cfg/nos3-mission.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<nos3-mission-cfg>
<start-time>814048200.0</start-time>
<gsw>cosmos</gsw>
<number-spacecraft>1</number-spacecraft>
<sc-1-cfg>sc-minimal-config.xml</sc-1-cfg>
</nos3-mission-cfg>
<start-time>814048200.0</start-time>
<!-- Note fprime gsw and fsw only operational in sc-minimal-config.xml -->

<!-- Ground Software -->
<!-- cosmos, openc3, or fprime -->
<gsw>cosmos</gsw>

<!-- Flight Software -->
<!-- cfs or fprime -->
<fsw>cfs</fsw>

<!-- Number of spacecraft -->
<number-spacecraft>1</number-spacecraft>

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

<!-- Spacecraft N Configuration -->
<!-- <sc-N-cfg>sc-minimal-config.xml</sc-N-cfg> -->
</nos3-mission-cfg>
12 changes: 8 additions & 4 deletions cfg/nos3_defs/arch_build_custom.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,22 @@
add_compile_options(
#-std=c99 # Target the C99 standard (without gcc extensions)
#-pedantic # Issue all the warnings demanded by strict ISO C
-Wall # Warn about most questionable operations
#-Wall # Warn about most questionable operations
#-Wstrict-prototypes # Warn about missing prototypes
-Wwrite-strings # Warn if not treating string literals as "const"
-Wpointer-arith # Warn about suspicious pointer operations
#-Wwrite-strings # Warn if not treating string literals as "const"
#-Wpointer-arith # Warn about suspicious pointer operations
#-Werror # Treat warnings as errors (code should be clean)
-Wno-address-of-packed-member
#-Wno-address-of-packed-member
# Build Specific
-DBYTE_ORDER_LE
-D_LINUX_OS_
-D_DEFAULT_SOURCE
)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wstrict-prototypes -pedantic -Werror")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wwrite-strings -Wpointer-arith -Wno-address-of-packed-member")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")

if (CFE_SYSTEM_PSPNAME STREQUAL "nos-linux")
# find itc cmake module path
find_path(_ITC_CMAKE_MODULES_
Expand Down
1 change: 1 addition & 0 deletions cfg/nos3_defs/cpu1_cfe_es_startup.scr
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ CFE_APP, novatel_oem615, NOVATEL_AppMain, NAV,
CFE_APP, sample, SAMPLE_AppMain, SAMPLE, 71, 32768, 0x0, 0;
CFE_APP, generic_st, ST_AppMain, ST, 71, 32768, 0x0, 0;
CFE_APP, syn, SYN_AppMain, SYN, 72, 32768, 0x0, 0;
CFE_APP, generic_thruster, GENERIC_THR_AppMain, THRUSTER, 73, 32768, 0x0, 0;

CFE_LIB, cfs_lib, CFS_LibInit, CFS_LIB, 0, 0, 0x0, 0;
CFE_APP, cs, CS_AppMain, CS, 55, 16384, 0x0, 0;
Expand Down
Loading

0 comments on commit 79c9232

Please sign in to comment.