OpenSatKit
A Tool Suite for Working with
NASA’s Core Flight System
Workshop on Open-Source
Space Missions Design Tools
David McComas
[email protected]
Open STEMware Foundation 3/1/22
1
Introduction
OpenSatKit • OpenSatKit was originally created to help flight software
developers adopt and work with NASA’s core Flight System (cFS)
• OpenSatKit combines COSMOS, cFS, and 42 into a single platform
Simulator
– All users must install the complete system regardless of their goals
• OpenSatKit is currently being decomposed into multiple
on components that can be combined to better serve user needs
Ubuntu • Agenda
Linux
1. Describe the new tool suite
2. Demonstrate end-to-end simulation using the current OpenSatKit
3. Demonstrate cFS app development using cFS Application Toolkit (cFSAT)
• This slide deck contains many details that will not be presented, but
Command & Control will be valuable as a future reference
Workshop on Open Source Space Mission Design Tools Page 2
NASA’s core Flight System
NASA’s core Flight System (cFS) is
an open-source flight software (FSW)
framework providing an application
runtime environment that is portable
across different hardware/operating
system platforms.
The cFS provides a high quality FSW
with decades of flight heritage.
Workshop on Open Source Space Mission Design Tools Page 3
cFS Layered Architecture
Platform Abstraction: Provides portability across different operating systems including Linux, FreeRTOS, and RTEMS
Application Services: Creates an application runtime environment that allows apps to be reused across projects
Libraries and Apps: Provide project functionality
Bundle Applications
Libraries and Applications & Libraries
NASA
Application Services cFS Bundle
NASA
Platform Abstraction cFS Framework
Workshop on Open Source Space Mission Design Tools Page 4
OpenSatKit Overview
• OpenSatKit (OSK) is suite of open-source products built upon NASA’s core Flight
System (cFS)
• It provides:
1. A cFS educational platform
2. A design & development environment for mission flight software applications
3. Platforms for STEM** education and hobbyists
4. Platforms for technology development
OSK Runtime Bundle
• Built on NASA’s cFS Electronic Data Sheet (EDS) Framework
– EDS supports standards-based interface specifications
• The app suite provides essential flight software functionality
– Command & Telemetry ground interfaces
– Onboard file management and ground-flight file transfers
• Assured framework-app compatibility
Workshop on Open Source Space Mission Design Tools **Science Technology Engineering and Mathematics Page 5
OpenSatKit Product Suite
cFSAT Bundle Adds:
- Educational Apps
- PySimpleGUI for Simulator
Command, Telemetry,
& Control
Simulation Bundle Adds:
Pi-SAT Bundle Adds: - Mission Apps
- Raspberry Pi Apps - 42 Simulator
- PySimpleGUI for - COSMOS for
Command, Telemetry, Command, Telemetry,
& Control & Control
OpenSatKit Bundle
- Runtime App Suite
- cFS-EDS Framework
Workshop on Open Source Space Mission Design Tools Page 6
cFSAT
• Lightweight platform that serves as a cFS
– Educational platform
cFS Community – Application development environment
“EDS Apps”
• Suitable for software STEM educational projects including
– FSW application development and test
– Ground software data processing
• Uses the cFS with Electronic Data Sheets (EDS) Framework
– Includes an EDS toolchain that creates ground and flight software artifacts from cFS apps
packaged with an EDS interface specification
– Uses latest cFS v7 Caelum release
• Educational apps for training and self-guided tutorials
• Minimalistic Command, Telemetry and Control ground system
– Written in a lightweight portable python GUI framework called PySimpleGUI
• OpenSatKit-Apps is a github repository of cFS Apps with EDS specifications
Workshop on Open Source Space Mission Design Tools Page 7
Pi-SAT
• Adds Raspberry Pi libraries and apps
– Use low-cost Raspberry Pi boards to learn and use the cFS Framework
• Low-cost hardware platform ideal for learning how to write cFS “interface
apps”
– Provides command and telemetry interface to a hardware device
– Use Python to talk with your system
• Base platform can be customized for STEM educational projects
Workshop on Open Source Space Mission Design Tools Page 8
cFSIM
• Complete ground, flight, and dynamic simulation system including
– Ball Aerospace’s COSMOS command and control platform for embedded systems
Simulator
– NASA Goddard’s 42 dynamic simulator
• Suitable for
– Flight software application development and test
– End-to-end software simulation
– Ground software data processing
Workshop on Open Source Space Mission Design Tools Page 9
2022 OSK Product Roadmap
Current OpenSatKit
https://github.com/OpenSatKit/OpenSatKit/wiki cFSIM
Simulator
OpenSatKit
“EDS Apps”
Refactor
SimSat** on &
Distribute
Ubuntu Linux Beta Release
https://github.com/OpenSatKit/cfsat
cFSAT
Command, Telemetry
& Control
Workshop on Open Source Space Mission Design Tools
**SimSat = Reference mission flight software app suite Page 10
OpenSatKit
End-to-End Simulation
11
42 Standalone
42 Simulator
Measured
State Telemetry
Ephemeris,
Environment, Device FSW
Console
& Dynamic Models Commands
Models
Algorithms
Forces &
Torques
User interact with the
simulation via the console
and graphics
Workshop on Open Source Space Mission Design Tools Page 12
OpenSatKit 42 Simulation
42 Simulator
Ephemeris,
Environment, Device Flight Software
COSMOS Console
& Dynamic Models algorithms Manually
Models ported to an app
Screens
Command
Telemetry
Socket
Interface
Command
Flight Software Telemetry
Scripts Telemetry
Telemetry
Output
I42 F42
Commands
Command
Ingest
Osk_42_lib
Publish/Subscribe Message Bus
Workshop on Open Source Space Mission Design Tools Page 13
42 Flight Software App Telemetry
Flight software attitude control app defines
a “Take Science” flag
• Used by “operations” to determine when to
enable science data collection
• Set to TRUE when attitude errors on all three
axes are below a threshold
• Default threshold is .0005 radians
Workshop on Open Source Space Mission Design Tools Page 14
Demo Introduction
• Demo 1
– Use OpenSatKit screens to run and interact with a simulation
– Observe the behavior of the “take science” flag
• Demo 2
– Run a script that manages an ops scenario
• Waits for the “Take Science” flag to equal TRUE
• Powers on a simulated science instrument
• Notes
– OSK was originally designed for flight software developers so
– OSK does not have the latest version of 42
– The F42 app has changed with each 42 update, but not all F42’s functions have been updated
• Please provide feedback!
– These demos can serve as the start of a conversation for how OSK could better serve students
Workshop on Open Source Space Mission Design Tools Page 15
Demo Reference Slides
Workshop on Open Source Space Mission Design Tools Page 16
Running OSK (1 of 2)
1. Open a terminal window (Ctrl-Alt-t)
2. Navigate to the base directory where you installed OSK
– “~/” is used to indicate the OSK base directory so “~/cfs” is equivalent to
“/home/user/OpenSatKit/cfs” if OpenSatKit was installed in the home directory for an account
named “user”
3. Change directory to cosmos
– cd ~/cosmos
4. Start COSMOS
– ~/cosmos$ ruby Launcher
5. Select <OK> to create the “Launcher” screen
shown on the next slide
Workshop on Open Source Space Mission Design Tools Page 17
Running OSK (2 of 2)
6. Select “OpenSatKit” icon with a single click
– This launches COSMOS’s Command and Telemetry Server,
Telemetry Viewer, and displays OSK’s main window
– You can minimize the COSMOS tools, but don’t close them
• Each tools on the COSMOS “Launcher” runs as a separate Linux
process with a Graphical User Interface (GUI)
• Shaded tool titles indicate the COSMOS tools used by OSK
– You do not have to invoke these tools directly
– OSK screens launch COSMOS tools as they are needed to perform a task
– A backup slide shows a COSMOS architectural view with the data flows
between tools
Workshop on Open Source Space Mission Design Tools Page 18
OSK Screen Driven System
• Four tabs cFS Education, Mission FSW, PiSat, and R&D correspond to four cFS targets/ OSK Use Cases
• Each tab’s screen has a similar layout and its own “Getting Started” Guide
User Objective Tab
System/Target
Management
Learning Resources
Content specific to
User Objective Tab
Workshop on Open Source Space Mission Design Tools Page 19
Mission Flight Software Tab
The Mission Flight Software tab manages the end-to-end simulation
The attitude determination and
control app group provides screens
to interact with the I42 and F42 apps
Workshop on Open Source Space Mission Design Tools Page 20
Attitude Determination and Control Applications
SimSat reference
Mission app suite
Launch screen
that is used in the
demo
Workshop on Open Source Space Mission Design Tools Page 21
42 Flight Software App Telemetry
Start script-based
Demo using COSMOS
Script Runner
Workshop on Open Source Space Mission Design Tools Page 22
Ops Script Demo
Workshop on Open Source Space Mission Design Tools Page 23
OSK Document Roadmap
OpenSatKit/docs
1 – OSK Quick Start: Top-level introduction to OSK and a roadmap for more in-depth engagement
3 – OSK COSMOS Guide: Describes how COSMOS has been configured and extended for OSK
– OSK App Developer’s Guide: Describes how to develop apps using the OSK application framework
OpenSatKit/cosmos/config/targets/CFSAT/docs (cFS educational platform)
– cFS Education Quick Start Guide: Introduction to OSK’s cFS educational target and associated resources
2 – core Flight System (cFS) Overview: Introduction to flight software (FSW) and NASA’s cFS
– core Flight Executive (cFE) Overview: Overview of the cFE framework and its application services
OpenSatKit/cosmos/config/targets/CFE_[service] /docs
– Each cFE service contains its own tutorial document
OpenSatKit/cosmos/config/targets/SIMSAT/docs (cFS-based mission)
– Mission FSW Quick Start Guide: Introduction to OSK’s cFS-based mission target and associated resources
– Simple Sat Overview: Describes the SimpleSat reference mission
– Application Group Guides: Multiple documents that describe how groups of cFS community apps work together
OpenSatKit/cosmos/config/targets/PISAT/docs (Raspberry Pi distro for STEM education)
– Pi-Sat Quick Start Guide: Introduction to OSK’s Raspberry Pi target and associated resources
OpenSatKit/cosmos/config/targets/SANDBOX/docs (cFS application playground)
– Research & Development Quick Start Guide: Introduction to OSK’s R&D target and associated resources
Recommended reading order if you’re new to the cFS. The next steps depends on your goals.
Workshop on Open Source Space Mission Design Tools Page 24
OpenSatKit 42 Notes
• 42 configuration
– The OpenSatKit/42/OSK directory contains the 42 configuration files used in the simulation
– Flight software and 42 time is not synchronized
• Simple/Simulated Satellite (SimSat) is a fictitious reference mission
– The SimSat Quick Start Guide is incomplete
• The demo ops script is located at
– OpenSatKit/cosmos/config/targets/SIMSAT/procedures/demo_ctrl_take_sci.rb
• I42 and F42 command and telemetry definitions serve as the current documentation
– OpenSatKit/cosmos/config/targets/F42/cmd_tlm
– OpenSatKit/cosmos/config/targets/I42/cmd_tlm
• The process to develop and port new algorithms from 42 to a flight software app is
complicated and undocumented
Workshop on Open Source Space Mission Design Tools Page 25
Creating a “Hello World”
Flight Software Application
26
Objectives
• Guide participants through the process of creating and running
a core Flight System (cFS) application
• Introduce technical concepts including
– cFS framework and applications
– CCSDS Electronic Data Sheets (EDS)
– OpenSatKit application framework
Workshop on Open Source Space Mission Design Tools Page 27
Approach
• The short introduction will be a normal slide presentation
• After cFSAT is installed, we will run the python ground system and use it to
launch tutorials that will step us through exercises
• We will perform each exercise together and I will pause for any questions
• Significant effort was made to minimize prerequisites
– Multiple concepts, systems, tools, and workflows are applied, but a detailed knowledge of these is not required
• Versioning notes
– cFS is a prerelease of Caelum
– cFSAT is a beta release
– The OSK framework library (osk_c_fw) and demo app (osk_c_demo) originated from OSK
3.2 (cFS Aquila)
• They have been updated to cFS Caelum
• Transferred to their own repos in the OpenSatKit-Apps project
Workshop on Open Source Space Mission Design Tools Page 28
Agenda
1. cFS and cFSAT Introduction
2. cFSAT Installation**
3. Hands on Exercises
A. Build and Run the cFS
B. Create Hello World App
C. Modify Hello World App
** https://github.com/OpenSatKit/cfsat
Workshop on Open Source Space Mission Design Tools Page 29
cFS Architectural Overview
• cFS uses a three-tiered software architecture that provides a portable flight software
framework with a product line deployment model
• Platform Abstraction Layer ports to different operating systems (OS) / processor combinations
• Compile-time configuration parameters and run-time command/table parameters provide
adaptability and scalability
• cFE Framework provides portable application runtime environment
• Mission functionality implemented by a combination of reusable and mission-specific apps
Application
CI_LAB, SCH_LAB,
Layer Applications and Libraries TO_LAB, SAMPLE
Application
cFE API
Service cFS
Layer Core Flight Executive Bundle
cFS
Framework
Platform OS Abstraction API PSP API
Abstraction Linux VxWorks
Platform
RTEMS
Layer Support
Port Port Port
Package
Workshop on Open Source Space Mission Design Tools See backup slide for GitHub repos Page 30
cFS Application Architectural Context
• The cFE, Operating System Abstraction Layer (OSAL), and Platform Support Package
(PSP) provide services and access to system resources for applications
• The Software Bus (SB) is the predominant service that needs to be understood for this
tutorial
– OSK’s cfsat target documentation provides cFS educational material
https://github.com/OpenSatKit/OpenSatKit/tree/master/cosmos/config/targets/CFSAT/docs
• SB provides a publish/subscribe message bus
– Apps publish messages on the bus using a broadcast model
– Apps received messages by creating pipes (FIFO queue) and subscribing to messages on
a pipe
CCSDS SB CCSDS
Message Message
Pipe
Sending Receiving
App App
Workshop on Open Source Space Mission Design Tools Page 31
cFS Application Runtime Environment
cFS Framework
A core set of apps are required to provide a
Send HK runtime environment
Execute Cycle
– Different app implementations can provide
Scheduler App X
customized solutions for different platforms
– File management & transfer not shown
App X HK Tlm
Cmds
Scheduler (SCH) sends messages at fixed time
intervals to signal apps to perform a particular
Command Telemetry function
Ingest Output
UDP UDP
Command Ingest (CI) receives commands from an
Port 1234 Port 1235 external source and publishes them on the SB
cFSAT Python Ground System
Telemetry Out (TO) receives messages from the SB
and sends them to an external destination
Workshop on Open Source Space Mission Design Tools Page 32
Application Run Loop Messaging Example
Initialize App
Subscribe to send
Start housekeeping, exec,
Suspend execution until a command messages
message arrives on app’s pipe
Pend on SB message pipe
Periodic execute message from
SCH app
Yes Perform periodic
Exec?
functions
Periodic send housekeeping No
message from SCH app
• Typically, on the order of seconds Send Yes
Send HK message
• “Housekeeping cycle” convenient HK?
time to perform non-critical functions
No
Yes
Cmd? Process Command
Process commands
• Commands can originate from
ground or other onboard apps No
Workshop on Open Source Space Mission Design Tools Send error event Page 33
Electronic Data Sheets
• An Electronic Data Sheet (EDS) is a formal specification of a device, system, or
software interface in a machine-readable format
• EDS specifies black box view of interfaces
C Header Files Flight
C Header Files
C Header Files Software
EDS Compile Time Process
Lua/Python
Bindings
Ground
System
Single definition of data in EDS propagates to rest of system.
Workshop on Open Source Space Mission Design Tools Page 34
cFSAT Python Ground System
Create Run
App Tool Tutorial
Send Configuration Send Commands Display Telemetry
Commands to cFS from cFS
Workshop on Open Source Space Mission Design Tools Page 35
Install cFSAT Prerequisites
Workshop on Open Source Space Mission Design Tools Page 36
Clone cFSAT Repo and Run Python Ground System
Workshop on Open Source Space Mission Design Tools Page 37
Hand on Exercises
The remainder of this workshop will be performed by launching tutorials from cFSAT’s
Tutorial menu
We will be using the following tutorials
1. Build and Run the cFS
2. Create Hello World App
Workshop on Open Source Space Mission Design Tools Page 38