Git Product home page Git Product logo

ctlst-tech / uas-catpilot Goto Github PK

View Code? Open in Web Editor NEW
34.0 4.0 2.0 2 MB

CatPilot is a hardware and OS agnostic drone's autopilot software stack. It is designed for faster creation of scalable distributed control systems for mission-critical applications. (UAS-CatPilot repo is a upper lever repo for sharing configurations for UAVs)

Home Page: https://docs.ctlst.app

License: BSD 3-Clause "New" or "Revised" License

CMake 17.22% C 17.92% Makefile 5.00% Python 59.86%
autopilot drone uav c-language c-library cube freertos mission-control stm32 uas

uas-catpilot's Introduction

CatPilot is a drone's autopilot software stack designed to create scalable, distributed embedded software systems.

CatPilot key idea is to use top-level domain-specific notations for specifying desired behavior. And the minimalistic generalized C-language codebase to execute it for real-time mission-critical applications.

Key features

  • written in C language;
  • extends via atomic functions - reusable blocks with supporting code generation from formal description;
  • integrates to the specific vehicle by XML-shaped DSLs, which are orchestrated by model-based design tools;
  • provides hardware and OS-agnostic stack that can easily migrate from one hardware to another while growing from prove-of-concept prototype to the certification grade solution;
  • provides services for telemetry transmission, logging and visualization.

Atomic functions

1. Create formal representation
from fspeclib import *

Function(
    name='core.quat.prop',
    title=LocalizedString(
        en='Propagate quaternion'
    ),
    inputs=[
        Input(
            name='omega',
            title='Angular rate vector',
            value_type='core.type.v3f64'
        ),

        Input(
            name='q0',
            title='Initial quat',
            value_type='core.type.quat'
        ),

        Input(
            name='q',
            title='Recurrent quat',
            value_type='core.type.quat'
        ),

        Input(
            name='reset',
            title='Reset',
            description='Command for re-initializing output quat by q0',
            value_type='core.type.bool',
            mandatory=False
        ),
    ],
    outputs=[
        Output(
            name='q',
            title='Updated quat',
            value_type='core.type.quat'
        ),
    ],
    state=[
        Variable(
            name='inited',
            title='Initialized flag',
            value_type='core.type.bool'
        ),
    ],

    injection=Injection(
        timedelta=True
    )
)
2. Generate integration software and the implementation stub

Simply run:

fspecgen.py --code --cmake --f_specs_dirs project:./atomics/ catpilot:catpilot/atomics/ catom:catpilot/c-atom/atomics/

Check Manual for details documentation for details

3. Implement behaviour
#include "core_quat_prop.h"

void core_quat_prop_exec(
    const core_quat_prop_inputs_t *i,
    core_quat_prop_outputs_t *o,
    core_quat_prop_state_t *state,
    const core_quat_prop_injection_t *injection
)
{
    if (i->optional_inputs_flags.reset) {
        if (i->reset) {
            state->inited = 0;
        }
    }

    if (state->inited == FALSE) {
        o->q = i->q0;
        state->inited = 1;
    } else {
        o->q.w = i->q.w + -0.5 * ( i->q.x * i->omega.x + i->q.y * i->omega.y + i->q.z * i->omega.z ) * injection->dt;
        o->q.x = i->q.x +  0.5 * ( i->q.w * i->omega.x + i->q.y * i->omega.z - i->q.z * i->omega.y ) * injection->dt;
        o->q.y = i->q.y +  0.5 * ( i->q.w * i->omega.y + i->q.z * i->omega.x - i->q.x * i->omega.z ) * injection->dt;
        o->q.z = i->q.z +  0.5 * ( i->q.w * i->omega.z + i->q.x * i->omega.y - i->q.y * i->omega.x ) * injection->dt;
    }
}
4. Integrate and reuse easily
<f name="integrate_att" by_spec="core.quat.prop">
    <in alias="wx">omega_x/output</in>
    <in alias="wy">zero/output</in>
    <in alias="wz">zero/output</in>
    <in alias="q0">initial_euler/q</in>
    <in alias="q">norm_att_quat/q</in>
</f>
5. Check existing atomic functions catalog

Catalog's link

DSL based integration

Define top level behavior in the problem-oriented notation:

  • swsys - software system description layer; allocates functions and other blocks into tasks and processes.
  • flow - block to arrange computational graphs as a sequence of atomic reusable functions.
  • fsm - finite state machine notation, operates by states, transitions and actions on states and transitions.
  • ibr - interface bridge - designed to take care of converting information from and to other devices.
More info

Documentation

Model-based design representation

View this GitHub project in C-ATLAS

Target's software system outlook

Software system

Atomic function orchestration outlook

Functional flow

Hardware integration outlook

Hardware schematic

Quick control interfaces creation

Check documentation for more info

Vizialization tools

Quick start and documentation

Quick start manual

Documentation

Hardware support

CatPilot supports:

  1. CubePilot
  2. Catalyst Aerospace Technologies devices family

Project structure

Software architecture

This repository is created to collaborate on functions and configurations for Unmanned Aerial Systems, while hardware and platform related software is implemented in catpilot repo. CatPilot relates on C-ATOM library for its generic functionality. Core platform-agnostic middleware is the Embedded Software Bus (ESWB) library.

The project intends to separate knowledge is well-defined related and easily reusable modules.

How to contribute

  1. Join Discord, ask questions, raise issues
  2. Create UAS-specific or generic atomic functions
  3. Extend the list of the supported hardware (by the way, C-ATOM is application agnostic embedded stack)
  4. Help to make the documentation crystal clear by adjusting the text or highlighting grey spots and problems

Join the community

Discord group

logo_discord.png

Follow the updates

uas-catpilot's People

Contributors

0ptim0 avatar hmldns 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

Watchers

 avatar  avatar  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.