Crate minikalman

source ·
Expand description

Kalman Filters for Embedded Targets (in Rust)

This is the Rust port of the kalman-clib library, a microcontroller targeted Kalman filter implementation. Uses micromath for square root calculations on no_std.

This implementation uses statically allocated buffers for all matrix operations. Due to lack of const generics for array allocations in Rust, this crate also provides helper macros to create the required arrays (see e.g. create_buffer_A).

Macros

  • Creates a buffer fitting the state transition matrix (num_states × num_states).
  • Creates a buffer fitting the input transition matrix (num_states × num_inputs).
  • Creates a buffer fitting the temporary B×Q matrix (num_states × num_states).
  • Creates a buffer fitting the measurement transformation matrix (num_measurements × num_states).
  • Creates a buffer fitting the Kalman gain matrix (num_states × num_measurements).
  • Creates a buffer fitting the state covariance matrix (num_states × num_states).
  • Creates a buffer fitting the temporary P matrix (num_states × num_states).
  • Creates a buffer fitting the input covariance matrix (num_inputs × num_inputs).
  • Creates a buffer fitting the measurement uncertainty matrix (num_measurements × num_measurements).
  • Creates a buffer fitting the innovation covariance matrix (num_measurements × num_measurements).
  • Creates a buffer fitting the temporary B×Q buffer (num_measurements × num_measurements).
  • Creates a buffer fitting the temporary H×P matrix (num_measurements × num_states).
  • Creates a buffer fitting the temporary K×(H×P) buffer (num_states × num_measurements).
  • Creates a buffer fitting the temporary P buffer (num_states × num_states).
  • Creates a buffer fitting the temporary P×H^-1 buffer (num_states × num_measurements).
  • Creates a buffer fitting the temporary S-inverted (num_measurements × num_measurements).
  • Creates a buffer fitting the temporary x predictions (num_states × 1).
  • Creates a buffer fitting the input vector (num_inputs × 1).
  • Creates a buffer fitting the state vector (num_states × 1).
  • Creates a buffer fitting the innovation vector (num_measurements × 1).
  • Creates a buffer fitting the measurement vector z (num_measurements × 1).

Structs

  • Kalman Filter structure.
  • A matrix wrapping a data buffer.
  • Kalman Filter measurement structure.

Type Definitions