Adopting the Python language for On-board Programmable Payload Autonomy Steven Doran 2016 Flight Software Workshop 12/14/2016.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Names and Bindings.
Performed by: Yair Sommer Rea Yeheskel Instructor: Idan Katz In Cooperation with:Motorola הטכניון - מכון טכנולוגי לישראל הפקולטה להנדסת חשמל Technion -
Chapter 15 Design, Coding, and Testing. Copyright © 2005 Pearson Addison-Wesley. All rights reserved Design Document The next step in the Software.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Performed by: Yair Sommer Rea Yeheskel Instructor: Idan Katz In Cooperation with:Motorola הטכניון - מכון טכנולוגי לישראל הפקולטה להנדסת חשמל Technion -
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
CS 350 Operating Systems & Programming Languages Ethan Race Oren Rasekh Christopher Roberts Christopher Rogers Anthony Simon Benjamin Ramos.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
MAPLDDesign Integrity Concepts You Mean We’re Still Working On It? Sustaining a Design.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
1 Description and Benefits of JWST Commanding Operations Concept TIPS/JIM Meeting 17 July 2003 Vicki Balzano.
Programming Languages Design Considerations (Qualities) Readability –Simplicity and Clarity –Orthogonality –Control Statements –Data Types and Structures.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
CE Operating Systems Lecture 3 Overview of OS functions and structure.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 9.
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
1 Classes II Chapter 7 2 Introduction Continued study of –classes –data abstraction Prepare for operator overloading in next chapter Work with strings.
Classes, Interfaces and Packages
Oracle10g Developer: PL/SQL Programming1 Objectives Named program units How to identify parameters The CREATE PROCEDURE statement Creating a procedure.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Python C API overview References:
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Embedded Real-Time Systems
Benefits of a Virtual SIL
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
Chapter 10 Application Development
Space FSW Conference 2016 Matthew Conte Software Engineer
Chapter 3: Windows7 Part 5.
Development Environment
Using Ada-C/C++ Changer as a Converter Automatically convert to C/C++ to reuse or redeploy your Ada code Eliminate the need for a costly and.
CMSC 341 Lecture 2 – Dynamic Memory and Pointers (Review)
Simulink Interface Layer (SIL)
Software Configuration Management
Introduction to Operating Systems
Processes and threads.
Current Generation Hypervisor Type 1 Type 2.
Module 9: Memory and Resource Management
Chapter 3: Process Concept
Topics Covered What is Real Time Operating System (RTOS)
CS399 New Beginnings Jonathan Walpole.
Objectives Identify the built-in data types in C++
Linking & Loading.
Overview of today’s lecture
LCGAA nightlies infrastructure
JPL Autonomous Space Mission Simulation
Chapter 2: Operating-System Structures
Chapter 3: Windows7 Part 5.
Introduction to Operating Systems
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Page Replacement.
Chapter 2: System Structures
System Structure and Process Model
Process Description and Control
Classes and Objects.
Units with – James tedder
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Chapter 2: Operating-System Structures
Outline Chapter 2 (cont) OS Design OS structure
Chapter 3: Processes.
CS703 - Advanced Operating Systems
Recitation Course 0603 Speaker: Liu Yu-Jiun.
Outline Operating System Organization Operating System Examples
System calls….. C-program->POSIX call
Chapter 2: Operating-System Structures
Implementation of page-replacement algorithms and Belady’s anomaly
Rust for Flight Software
SPL – PS2 C++ Memory Handling.
Presentation transcript:

Adopting the Python language for On-board Programmable Payload Autonomy Steven Doran 2016 Flight Software Workshop 12/14/2016

Introduction On legacy systems Northrop Grumman (NGC) Azusa is task to maintain an autonomous commanding capability called “Stored Programs” Stored Programs are pre-programmed sequences of executable statements stored as database items onboard the payload Provides pre-programmed delivery of commands to the Flight Software (FSW) Includes either Time or Conditional statements for execution Written in a Non-NGC Proprietary scripting language Requires training to learn the Stored Program Interpreter functionality and language For future payloads, an NGC in-house ability for Stored Program functionality is being sought

Stored Program Flow Load Execute Complete (Success / Fail) Unload Upload from Ground Find and Store Load Execute Complete (Success / Fail) Unload

Replacement Candidate Requirements An informal study was launched to find a replacement candidate for the legacy Stored Program Interpreter Replacement Candidate Requirements Adopts a common high high-level programming language Requires no specialized training and eliminating a “niche” engineering skill Full use of Interpreter without restrictions Core Functionality Conditional Statements Delay Statements Read Telemetry Monitors in Real-Time Send FSW Commands (From Script) Python Satisfies all Requirements so a Prototype Study was initiated to determine Feasibility

Python Overview Python is a high-level programming language Interpreted (vs. compiled) Open Source Readable Syntax Modular Extremely popular with wide use adoption

Python / C++ API Python/C API allows to embed Python source code into a C/C++ Application Built-in Python Interpreter Reads either a external file or String containing one or more Python statements #include <Python.h> int main (){ Py_Initialize(); PyRun_SimpleString("print Hello World\n"); Py_Finalize(); return 0; }

Python / C++ API Commands* Py_SetProgramName(char *name) – Sets Program name (default is Python) Py_Initialize() – Initialize the Python Interpreter PyRun_SimpleString(const char *command, PyCompilerFlags *flags) – Runs a Python statement PyRun_SimpleFile(FILE *fp, const char *filename) – Runs a Python file Py_Clear() – Removes the internal reference (Python Objects) to the Python Module Py_Finalize() – Removes all memory allocations and closes the Python Interpreter * Refer to Python/C API Reference Manual

Python / C++ Interconnectivity (Memory Management) The C/C++ Python Interpreter involves a private heap containing all Python objects and data structures Managed by the Python memory manager Interfaces with the OS to ensure enough memory space is allocated for the embedded Python Program Area for concern for Statically-allocated FSW applications Not a show stopper Inefficient data transfers between C ↔ Python Potential issue w/ conditional statements within Stored Program where telemetry values are required One of the focuses of Prototype Demonstration Allows for Dynamic allocation of memory (malloc, realloc, free) Functionality will be prohibited on Stored Programs Not required and a reliability issue

Python / C++ Interconnectivity (Exception Handling) All functions in the Python/C API can raise exceptions If an exception occurs the object being referenced is deleted and an error flag is set Python try ... except statement Improved capability than the Legacy Stored Program interpreter

Python Stored Program Constraints Python Stored Programs must be contained in a Python try ... except Exception Block Stored Programs cannot use the Python / C++ API Functionality Preserve FSW deterministic behavior Complex to debug No requirement to perform multi-threaded Stored Programs Only one instance of a Python Stored Program can execute at a time Matches Legacy System Python Stored Programs only have reference memory allocations to the FSW memory space Preserve FSW data integrity Python Stored Programs are a maximum size Constrains the maximum API’s private heap space allocation Prototype testing to determine maximum size

Python Stored Program Constraints (cont.) Python Stored Programs cannot launch another Stored Program This is done w/ the legacy system due to the legacy systems Stored Program size constraint

Python Stored Program (Containers) When a Python Stored Program is initiated, it is contained in its own unique thread that is removed once Stored Program execution completes The Python Stored Program’s memory access is limited to an allocated section of memory to prevent impacts to overall system Python Interpreter is closed at the end of the Stored Program execution and allocated heap space cleared Goal is to Prevent Stored Program Error from Propagating to The Flight Software

Python Stored Program (Containers) (cont.) 2 3 1 Scheduler Stored Program Thread Launched Scratchpad Memory Python Execute CMD Stored Program Completes 5 Thread Removed From Scheduler Stored Program Thread Killed 4

Commanding and Telemetry Python Stored Programs read FSW telemetry monitor states by a reference table in its assigned Memory scratchpad Python Stored Programs send FSW commands using command FIFO in its assigned Memory scratchpad Python Execute Scratchpad Memory TLM Monitor Ref Table CMD Queue Fight Software (FSW) Command Manager Telemetry Manager

Timing Python Stored Programs are required to use the System Time for command processing Python Stored Programs read a System Clock reference register in its assigned Memory scratchpad Python Execute Scratchpad Memory System Time Fight Software (FSW) System Manager

Python Stored Program (Off-Nominal Processing) The Flight Software monitors the execution of the Python Stored Program If required, the Flight Software can abort the Python Stored Program Calls the Py_Clear() and Py_Finalize() API calls to clear heap space and close the Python interpreter Kills the Stored Program thread

Demonstration Overview A experimental FSW application is commanded to launch a small Python Stored Program The Python Stored Program contains a conditional statement if a telemetry monitor is True/False Command processed is based on True/False condition Telemetry monitor will be updated based on Stored Program processing Demonstration Tests Core Functionality of Stored Programs

Prototype Demonstration Environment Test Station (Commanding / Telemetry) Development Workstation (FSW / Stored Programs) ethernet Command to launch Stored Program sent from test station Communication via ethernet

Current Status / Future Work Higher Priority tasks prevented completion of the demonstration this year Prototype testing to date shows Python Stored Program scripting is feasible and easy to implement Plan is to complete the demonstration next year and use more complex Stored Programs

References Python/C API Reference Manual www.python.org

Abstract Abstract: This presentation describes the development and implementation of adopting the Python programming language for programmable autonomous commanding and mission processing for future spaced-based payloads. The presentation outlines the many advantages of adopting the Python programming language of autonomous commanding. The presentation also discusses the incorporation of the Python interpreter into the future On-orbit Payload (OP) Flight Software, including the implementation of the “container” strategy to prevent a processing error within the uploaded Python script from propagating to the OP Flight Software’s State of Health (SOH) and mission processing.