Code Monkey home page Code Monkey logo

cubium's Introduction

Cubium

Build Status

Cubium is a free and open-source flight software for Linux-based spacecraft systems. Cubium allows for a more standardized and streamlined method of handling systems with many connected components by providing the neccesarry network to allow automatic discovery and communication between components. Developed with undergraduate CubeSat teams using systems such as Beaglebone Blacks and Raspberry Pis in mind, Cubium's purpose is to lower the bar of entry for satellite development.

Cubium is designed using the Space Plug-and-play Architecture (SPA), a specification for a kind of modular satellite software architecture. It has a proven mission-success track record on Air Force and Space Dynamics Laboratory payloads.

For a fun introduction on the inner workings of Cubium, see this illustrated writeup.

For a very detailed look into the machinations of SPA in general, see Jacob Holt Christensen's dissertation.

Project Status

  • Version Alpha 2.0.0
    • Added interfacing with Python components
    • Major bugfixes
    • Architecture ready for flight testing
  • Version Alpha 1.2.0
    • Support for sending strings between components
  • Version Alpha 1.1.0
    • Finalized architecture for software demo shown at SmallSat conference
  • Version Alpha 1.0.0
    • All necessary framework completed for support of basic component systems.
  • Version Alpha 0.0.6
    • Successful transmission of SPA messages across processes via socket communication
  • Version Alpha 0.0.5
    • Major backend refactoring of SPA Messages
  • Version Alpha 0.0.4
    • Added a basic subscription service
      • Direct component-to-component subscription
      • Non-prioritized publishing
    • Improvements to message handling
    • Additional tests for components
  • Version Alpha 0.0.3
    • Basic implementations of:
      • Local SpaMessages
      • Components
      • Local Subnet Manager
  • Version Alpha 0.0.2
    • Debian dev environment complete
  • Version Alpha 0.0.1
    • Planning API's and project planning

Getting Started

Developer Tools

Cubium relies on a handful of developer tools. The following is a list of things we'll be using:

  • Vagrant - Virtual development environment
  • Git - Version control system
  • Google Test - Unit testing framework
  • Doxygen - Documentation generator
  • CMake - Build system automation

Set up Vagrant

Cubium uses Vagrant to create a development environment to match the devices that Cubium will run on. It also eliminiates "well, it works on my system" bugs.

For instructions on getting the dev environment up and running, see the wiki page

Build Project

TL;DR

  • Run CMake in project directory cmake .
  • Run generated makefile make [optional-target]

Cubium uses CMake for a build system. Makefiles are generally platform-dependent, so CMake generates a different Makefile for each system in order to allow for cross-plaform functionality.

Build Docs

TL;DR

  • Run Doxygen with project doxyfile doxygen ./Doxyfile
  • View your docs. They should now live in docs/

Cubium uses the documentation generator Doxygen to build documentation. Annotated source code is parsed by Doxygen to generate LaTeX and HTML files.

Doxygen is configured with a file titled Doxyfile.

  • Build Documentation
    • Invoke commandline tool
      • doxygen Doxyfile

This will read all configuration options from the Doxyfile, find and parse the source code, and generate the documentation.

If the documentation is successfully built, there should be a new directory title docs/ that should contain both HTML and LaTeX documentation.

  • Read Docs
    • Open up docs/html/index.html in your web browser to browse docs

Running Tests

Cubium tests use the Google Test testing framework for unit testing. Test test test.

  • To run test suite:
    • Generate a makefile with CMake cmake .
    • Build tests with makefile make runTests
    • Run test executable ./runTests

Testing

Cubium uses Google Test for unit testing and CMake for a build system. The short version of running tests is this:

Classes should be kept small and have functioning unit tests. When adding a new header file for a class, a header file of the same name should be added to the test/ directory.

To add a new class to the project:

  • Create header file my_class_name.hpp (File names should be snake case - lowercase words seperated with underscores)
    • Define class
    #ifndef MY_CLASS_NAME_HPP
    #define MY_CLASS_NAME_HPP
      class MyClassName{};
    #endif
    • Must have include guards
    • Class name should be UpperCamelCase, where each first letter of a words is capitalized. Including the first word.
  • Add new testing file test/my_class_name.hpp
  • Write tests for your class
    #include "../path/to/my_class_name.hpp"
    
    TEST(MyClassName, myMethod){
      MyClassName myClass;
      EXPECT_EQ(myClass.myMethod(),0);
    }
    • Be sure to include class header in test file
  • Include your test header in main test file
    • Open test/gtest_main.cpp
    • Include your new test header file
  • Hooray! Now you can run your tests! :D

Documentation

Cubium uses Doxygen to build documentation from source code. This means that one can add comments with a special format in the code so that Doxygen may build pretty HTML docs that can be referenced by all other developers and users.

Here is an example of what this might look like to document a function.

  //! I am the brief message, I give a short overview of what a method does. I need to be followed by a whitespace

  //! \param myParam - I describe myParameter
  //! \return - I describe a return value
  bool example(int myParam){return true;}

cubium's People

Contributors

ammonhepworth avatar carsonfox avatar commanderscotty avatar cschmittiey avatar kylehovey avatar kylereese avatar phat-sumo avatar philipnelson5 avatar sailanarmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cubium's Issues

DRIVERS

  • Real-Time Clock
  • Gyroscope/Magnetometer
  • Temperature
  • Analog temperature
  • Boom (wire-cutter)
  • Light
  • UV
  • Radio
  • Battery Voltage
  • Camera
  • Median Filter (software only)
  • Aggregator (software only)

CTRL + C to quit out of Python Drivers

CTRL + C does not work when trying to quit out of the python drivers, we need to find out how to kill them instead of having to open up htop every time.

Boom

The Aeroboom is deployed by activating wire cutters over a Digital (GPIO) connection. In the arduino, it used to be pinMode(location of the pin, OUTPUT);

The boom is the most critical part of our mission. For the Satellite we must be able to give the boom logic of when to deploy which will need to be discussed in depth in a later meeting. As for now, the Boom must rely on radio control to receive a command to deploy. As for now, we must have this ready to be tested.

Battery Voltage

This is going to monitor the health of our current battery. We read this as an analog input and convert it into a voltage that we can read in order to see the health of our battery.

This will be handled later by our choice of battery in the future.

Real-Time Clock

The Real-Time Clock will also be critical to our mission. Speaking with Toshi and the Japanese GAS Team, they reset their payload once a day based on the RTC in case radiation flips any of the bits.

The device can be found here: https://www.adafruit.com/product/255

Gyroscope

Not sure why this is broken over serial, I have officially posted this on the Adafruit Forums and I will have to look more into it when I get a response. I will probably try to run this over I2C again to see if maybe the reason we segfaulted was because of faulty wiring since we had to replace the original cobbler.

Demo TODO

We've got pretty much all of the Cubium backbone that we need for this demo! Now:

  • Create a "light sensor" component, a "temperature sensor" component, a median filter component, and a "solar array" component connected to the LSM
  • Have the median filter subscribe to light sensor and temperature sensor
  • Have solar array subscribe to median filter
  • Light, temp, and median filter spit out data appropriate for real time graphs
  • Solar array triggers the servo program at the appropriately arbitrary moment

UV Sensor

The Analog UV sensor known as the GUVA-S12SD. Knowing how much UV is surround the boom and how much UV is in the boom box is vital to deployment of our Aeroboom.

There are two sensors for this mission.

The device can be found here: https://www.adafruit.com/product/1918

Aggregator and Getting Data

I have gotten the Gyro in a position where it can spit out data, however, when I use this code compared to the one that I have cloned down onto the pi. It doesn't spit out any data, this of course. Could be the fault of the software side of things not being about to print out the data we need.

However, I have also tried using the aggregator on the already done temperature sensor and no data goes through. I believe the aggregator needs to be looked at more carefully again and we need to verify that it is actually working with sensors that is pushing out data.

Drivers

ASSIGN A NEW ISSUE TO YOURSELF FOR YOUR SENSOR

  • Temperature - RAWL
  • Barometer - PHLEEP
  • Real Time Clock - CLEB
  • UV - Carson
  • Light - LARA
  • Radio - A-MON?
  • Boom - Jack
  • Gyroscope - JEK
  • GPS - KYLE (in progress)
    • Initial Draft
    • Testing
  • Battery Voltage - ETHAN
  • Filter - CARSON
  • Camera - HAILEE
  • Aggregator - Jack

Radio

Radio will be one of the most complex drivers to write. This is our primary form of communication. Commands must be encrypted (still in debate because FCC requires everything to be open source).

Commands as we have so far:
Take Picture
Deploy Boom

More will be added as the development of the Radio Driver is explored further in depth.

Next steps 2: Electric Boogaloo

This time the goal is to get Cubium to be good enough to start flying on our HAB payloads. In no particular order:

  • Continue abstracting and cleaning up component interfaces. I think we can even get creative with abstracting away the main function since all of the operational logic ends up in the class functions anyway. It would be cool to have a generalized main() for components.
  • SpaData is now generalized and can send strings!
  • Install the PREEMPT_RT patch
  • Get Google Test up and running and interface it with Travis CI
  • Did I mention drivers? :)

Immediate TODO

  • Component A send subscription request to LSM
  • Successfully route subscription request to Component B (this may require some changes to how the LSM handles cubiumSockets)
  • Component B send subscription reply & successfully route
  • Ensure subscriptions are tracked and handled a la SPA standard
  • Have the subscribee component pump out dummy data in the form of SpaData messages
  • Make sure subscriber component gets it. Have the subscriber just spit it out with cout or something.

Finnicky strings

Sending strings still sometimes doesnt work depending on the string. Who knows why?

Look into python interface options

@USUFox brought up that it might not be the greatest thing to be initializing a new python interpreter each time we get a new data point. Look into greasing the gears of the python interface.

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.