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)
BSD-3-CLAUSE License
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.
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
)
)
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
#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;
}
}
<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>
Define top level behavior in the problem-oriented notation:
View this GitHub project in C-ATLAS
Check documentation for more info
CatPilot supports:
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.