flight-solver 0.1.0

Real-time solvers for flight controllers
Documentation
  • Coverage
  • 100%
    76 out of 76 items documented4 out of 48 items with examples
  • Size
  • Source code size: 84.54 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.5 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 59s Average build duration of successful builds.
  • all releases: 59s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • noidvan/flight-solver
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • noidvan

Flight Solver

CI Crates.io docs.rs License: MIT

Real-time solvers for flight controllers. no_std, fully stack-allocated, const-generic over all dimensions.

Solvers

Module Algorithm Description
cls Constrained Least Squares Active-set solver with incremental Givens QR
cls::setup::wls WLS formulation Weighted LS with actuator-preference regularisation
cls::setup::ls LS formulation Plain (unregularised) least-squares
rls::standard Standard RLS Covariance-form with numerical guards
rls::inverse_qr Inverse QR-RLS Information-form via Givens rotations

Quick start

RLS - online parameter estimation

use flight_solver::rls::{InverseQrRls, RlsParallel, CovarianceGuards};

// Inverse QR-RLS: 4 regressors, 3 parallel outputs
let mut rls = InverseQrRls::<4, 3>::new(1e2, 0.995);

let a = nalgebra::SVector::<f32, 4>::new(0.1, -0.2, 0.3, 0.05);
let y = nalgebra::SVector::<f32, 3>::new(0.5, -0.3, 0.1);
rls.update(&a, &y);

CLS - constrained allocation

use flight_solver::cls::{solve, ExitCode, Mat, VecN};
use flight_solver::cls::setup::wls::{setup_a, setup_b};

let g: Mat<6, 4> = Mat::zeros();
let wv = VecN::<6>::from_column_slice(&[10.0, 10.0, 10.0, 1.0, 0.5, 0.5]);
let mut wu = VecN::<4>::from_column_slice(&[1.0; 4]);

let (a, gamma) = setup_a::<4, 6, 10>(&g, &wv, &mut wu, 2e-9, 4e5);
let b = setup_b::<4, 6, 10>(&VecN::zeros(), &VecN::from_column_slice(&[0.5; 4]), &wv, &wu, gamma);

let mut us = VecN::<4>::from_column_slice(&[0.5; 4]);
let mut ws = [0i8; 4];
let stats = solve::<4, 6, 10>(&a, &b, &VecN::zeros(), &VecN::from_element(1.0), &mut us, &mut ws, 100);

References

  • Haykin, S. Adaptive Filter Theory, 5th ed., Pearson, 2014. Ch. 15 - Square-root adaptive filtering (inverse QR-RLS derivation).
  • ActiveSetCtlAlloc - C reference implementation of the active-set WLS solver.
  • Indiflight - C reference implementation of the standard RLS with numerical guards.