Skip to content

Commit

Permalink
Merge pull request #355 from nasa/dev
Browse files Browse the repository at this point in the history
Release 1.7.1
  • Loading branch information
jlucas9 authored Aug 31, 2024
2 parents 983897d + fc47c0e commit 4d653f2
Show file tree
Hide file tree
Showing 37 changed files with 374 additions and 66 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:20240618
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:20240618
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ build
support/nos3_install.log
tmp
core.*
.cdskeyfile
.reservedkeyfile
.resetkeyfile
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@
path = components/syn
url = https://github.com/nasa-itc/syn.git
branch = main
[submodule "components/generic_thruster"]
path = components/generic_thruster
url = https://github.com/nasa-itc/generic_thruster.git
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ build-sim:
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/docker_checkout.sh

Expand Down Expand Up @@ -118,5 +123,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
10 changes: 10 additions & 0 deletions cfg/InOut/Inp_IPC.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,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
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
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 @@ -32,6 +32,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
30 changes: 15 additions & 15 deletions cfg/nos3_defs/tables/sc_rts001.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@
/* Custom table structure, modify as needed to add desired commands */
typedef struct
{
/* 1 - Enable DS */
SC_RtsEntryHeader_t hdr1;
DS_AppStateCmd_t cmd1;
/* 2 - Enable Debug */
SC_RtsEntryHeader_t hdr2;
TO_LAB_EnableOutputCmd_t cmd2;
/* 3 - Enable RTS 3-64 */
SC_RtsEntryHeader_t hdr3;
SC_RtsGrpCmd_t cmd3;
/* 4 - Enable LC */
SC_RtsEntryHeader_t hdr4;
SAMPLE_NoArgs_cmd_t cmd4;
LC_SetLCState_t cmd4;
/* 5 - Start RTS 3 (Safe Mode) */
SC_RtsEntryHeader_t hdr5;
SAMPLE_NoArgs_cmd_t cmd5;
SC_RtsEntryHeader_t hdr6;
LC_SetLCState_t cmd6;
SC_RtsCmd_t cmd5;
} SC_RtsStruct001_t;

/* Define the union to size the table correctly */
Expand Down Expand Up @@ -67,21 +70,18 @@ SC_RtsTable001_t SC_Rts001 = {
.cmd3.FirstRtsId = 3,
.cmd3.LastRtsId = 64,

/* 4 - Sample NOOP */
/* 4 - Enable LC */
.hdr4.TimeTag = 1,
.cmd4.CmdHeader = CFE_MSG_CMD_HDR_INIT(SAMPLE_CMD_MID, SC_MEMBER_SIZE(cmd4), SAMPLE_NOOP_CC, 0x00),
.cmd4.CmdHeader = CFE_MSG_CMD_HDR_INIT(LC_CMD_MID, SC_MEMBER_SIZE(cmd4), LC_SET_LC_STATE_CC, 0x00),
.cmd4.NewLCState = LC_STATE_ACTIVE,
.cmd4.Padding = 0x0000,

/* 5 - Sample Enable */
/* 5 - Start RTS 3 (Safe Mode) */
.hdr5.TimeTag = 1,
.cmd5.CmdHeader = CFE_MSG_CMD_HDR_INIT(SAMPLE_CMD_MID, SC_MEMBER_SIZE(cmd5), SAMPLE_ENABLE_CC, 0x00),

/* 6 - Enable LC */
.hdr6.TimeTag = 1,
.cmd6.CmdHeader = CFE_MSG_CMD_HDR_INIT(LC_CMD_MID, SC_MEMBER_SIZE(cmd6), LC_SET_LC_STATE_CC, 0x00),
.cmd6.NewLCState = LC_STATE_ACTIVE,
.cmd6.Padding = 0x0000,
.cmd5.CmdHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd5), SC_START_RTS_CC, 0x00),
.cmd5.RtsId = 3,
}
};

/* Macro for table structure */
CFE_TBL_FILEDEF(SC_Rts001, SC.RTS_TBL001, SC Example RTS_TBL001, sc_rts001.tbl)
CFE_TBL_FILEDEF(SC_Rts001, SC.RTS_TBL001, POR RTS001, sc_rts001.tbl)
98 changes: 98 additions & 0 deletions cfg/nos3_defs/tables/sc_rts003.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#include "cfe.h"
#include "cfe_tbl_filedef.h"

#include "sc_tbldefs.h" /* defines SC table headers */
#include "sc_platform_cfg.h" /* defines table buffer size */
#include "sc_msgdefs.h" /* defines SC command code values */
#include "sc_msgids.h" /* defines SC packet msg ID's */
#include "sc_msg.h" /* defines SC message structures */

/* Command Includes */
#include "generic_css_msg.h"
#include "generic_css_msgids.h"
#include "generic_fss_msg.h"
#include "generic_fss_msgids.h"
#include "generic_imu_msg.h"
#include "generic_imu_msgids.h"
#include "generic_mag_msg.h"
#include "generic_mag_msgids.h"
#include "generic_torquer_msg.h"
#include "generic_torquer_msgids.h"
#include "novatel_oem615_msg.h"
#include "novatel_oem615_msgids.h"
#include "generic_adcs_msg.h"
#include "generic_adcs_msgids.h"
#include "generic_adcs_adac.h"

/* Custom table structure, modify as needed to add desired commands */
typedef struct
{
/* 1 - Enable CSS */
SC_RtsEntryHeader_t hdr1;
GENERIC_CSS_NoArgs_cmd_t cmd1;
/* 2 - Enable FSS */
SC_RtsEntryHeader_t hdr2;
GENERIC_FSS_NoArgs_cmd_t cmd2;
/* 3 - Enable IMU */
SC_RtsEntryHeader_t hdr3;
GENERIC_IMU_NoArgs_cmd_t cmd3;
/* 4 - Enable MAG */
SC_RtsEntryHeader_t hdr4;
GENERIC_MAG_NoArgs_cmd_t cmd4;
/* 5 - Enable torquers */
SC_RtsEntryHeader_t hdr5;
GENERIC_TORQUER_NoArgs_cmd_t cmd5;
/* 6 - Enable GPS */
SC_RtsEntryHeader_t hdr6;
NOVATEL_OEM615_NoArgs_cmd_t cmd6;
/* 7 - Set ADCS to SUNSAFE_MODE */
SC_RtsEntryHeader_t hdr7;
Generic_ADCS_Mode_cmd_t cmd7;
} SC_RtsStruct003_t;

/* Define the union to size the table correctly */
typedef union
{
SC_RtsStruct003_t rts;
uint16 buf[SC_RTS_BUFF_SIZE];
} SC_RtsTable003_t;

/* Helper macro to get size of structure elements */
#define SC_MEMBER_SIZE(member) (sizeof(((SC_RtsStruct003_t *)0)->member))

/* Used designated intializers to be verbose, modify as needed/desired */
SC_RtsTable003_t SC_Rts003 = {
.rts = {
/* 1 - Enable CSS */
.hdr1.TimeTag = 1,
.cmd1.CmdHeader = CFE_MSG_CMD_HDR_INIT(GENERIC_CSS_CMD_MID, SC_MEMBER_SIZE(cmd1), GENERIC_CSS_ENABLE_CC, 0x00),

/* 2 - Enable FSS */
.hdr2.TimeTag = 1,
.cmd2.CmdHeader = CFE_MSG_CMD_HDR_INIT(GENERIC_FSS_CMD_MID, SC_MEMBER_SIZE(cmd2), GENERIC_FSS_ENABLE_CC, 0x00),

/* 3 - Enable IMU */
.hdr3.TimeTag = 1,
.cmd3.CmdHeader = CFE_MSG_CMD_HDR_INIT(GENERIC_IMU_CMD_MID, SC_MEMBER_SIZE(cmd3), GENERIC_IMU_ENABLE_CC, 0x00),

/* 4 - Enable MAG */
.hdr4.TimeTag = 1,
.cmd4.CmdHeader = CFE_MSG_CMD_HDR_INIT(GENERIC_MAG_CMD_MID, SC_MEMBER_SIZE(cmd4), GENERIC_MAG_ENABLE_CC, 0x00),

/* 5 - Enable torquers */
.hdr5.TimeTag = 1,
.cmd5.CmdHeader = CFE_MSG_CMD_HDR_INIT(GENERIC_TORQUER_CMD_MID, SC_MEMBER_SIZE(cmd5), GENERIC_TORQUER_ENABLE_CC, 0x00),

/* 6 - Enable GPS */
.hdr6.TimeTag = 1,
.cmd6.CmdHeader = CFE_MSG_CMD_HDR_INIT(NOVATEL_OEM615_CMD_MID, SC_MEMBER_SIZE(cmd6), NOVATEL_OEM615_ENABLE_CC, 0x00),

/* 7 - Set ADCS to SUNSAFE_MODE */
.hdr7.TimeTag = 5,
.cmd7.CmdHeader = CFE_MSG_CMD_HDR_INIT(GENERIC_ADCS_CMD_MID, SC_MEMBER_SIZE(cmd7), GENERIC_ADCS_SET_MODE_CC, 0x00),
.cmd7.Mode = SUNSAFE_MODE,
}
};

/* Macro for table structure */
CFE_TBL_FILEDEF(SC_Rts003, SC.RTS_TBL003, Safe Mode RTS003, sc_rts003.tbl)
10 changes: 5 additions & 5 deletions cfg/nos3_defs/tables/sch_def_msgtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@
** Component Include Files
*/
#include "cam_msgids.h"
#include "generic_adcs_msgids.h"
#include "generic_css_msgids.h"
#include "generic_eps_msgids.h"
#include "generic_fss_msgids.h"
#include "generic_imu_msgids.h"
#include "generic_mag_msgids.h"
#include "generic_radio_msgids.h"
#include "generic_reaction_wheel_msgids.h"
#include "generic_star_tracker_msgids.h"
#include "generic_thruster_msgids.h"
#include "generic_torquer_msgids.h"
#include "novatel_oem615_msgids.h"
#include "sample_msgids.h"
#include "generic_adcs_msgids.h"
#include "generic_star_tracker_msgids.h"

#include "syn_msgids.h"

/*
Expand Down Expand Up @@ -326,8 +326,8 @@ SCH_MessageEntry_t SCH_DefaultMessageTable[SCH_MAX_MESSAGES] =
{ { CFE_MAKE_BIG16(SCH_UNUSED_MID) } },
/* command ID #104 */
{ { CFE_MAKE_BIG16(SCH_UNUSED_MID) } },
/* command ID #105 */
{ { CFE_MAKE_BIG16(SCH_UNUSED_MID) } },
/* command ID #105 - Thruster HK */
{ { CFE_MAKE_BIG16(GENERIC_THRUSTER_REQ_HK_MID), CFE_MAKE_BIG16(0xC000), CFE_MAKE_BIG16(0x0001), CFE_MAKE_BIG16(0x0000) } },
/* command ID #106 */
{ { CFE_MAKE_BIG16(SCH_UNUSED_MID) } },
/* command ID #107 */
Expand Down
Loading

0 comments on commit 4d653f2

Please sign in to comment.