Code Monkey home page Code Monkey logo

pfl's Introduction

PFL - Python Flight Layer

A modular python flight layer for cubesats and smallsats

The purpose of PFL is to enable time and money constrained researchers to write flight software very quickly. This project relies heavily on BSD Stream Sockets, so a flight computer running either Linux or BSD is required.

Architecture

Modes

Modes are what define your mission. Your modes will run in a state machine, generally your modes will call out to servers to run commands or collect data. This should generally be high level and hardware agnostic.

For example, deployment.py will command servers to extend an antenna, then send telemetry to ground. After it sends telemetry, it will choose the next phase to be run, in this case that is detumble.py.

Servers

Servers exist as a translation layer between the hardware and everything else. They send and receive Msgs, and can interact with hardware.

For example, storage_server.py will act as a database for storing state (like how many times we've rebooted), as well as binary objects, like photographs. Simply send a StorageCmd.SAVE or StorageCmd.LOAD via Msg to persist or load data.

In power_server.py, there should be a way to send a POWER_LOW Msg to the power server. Once receiving this message, the server should query the power system to see if it is low on power, and respond to the caller.

Servers communicate with the rest of PFL via UNIX Stream Sockets. This means that you can write a server in any language you choose, as long as it can read and write to sockets. Simply open up a local socket and read and write to the socket file of the server you'd like to talk to. For now, messages are serialized using Python's pickle module. This will likely change to a more general serialization format as servers are written in different languages.

Types

Types exist to make everything a little bit safer. Command types ensure that we don't ask servers to do something that they are not expecting. For now, this is a little ugly. This may be replaced with a better RPC mechanism in the future, or at least improved greatly.

Getting Started

You will need to set your python path to the src directory. Do this by exporting the path of this repo:

$ cd pfl/src
$ export PYTHONPATH="$(pwd)"

Once you've done that, you should be able to run pfl by typing: $ src/pfl_modes/watchdog.py

pfl's People

Contributors

smorad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.