IZAR Flight Controller 1.0.0
IZAR Flight Controller running with an ESP32.
kalman_filter.h File Reference
#include <esp_err.h>
Include dependency graph for kalman_filter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kalman1d_t
 One-dimensional Kalman filter state. More...

Functions

esp_err_t kalman1d_init (kalman1d_t *kf, float init_pressure, float process_noise, float measurement_noise)
 Initialize a 1D Kalman filter instance.
float kalman1d_update (kalman1d_t *kf, float z)
 Perform a single Kalman filter update with a new measurement.

Function Documentation

◆ kalman1d_init()

esp_err_t kalman1d_init ( kalman1d_t * kf,
float init_pressure,
float process_noise,
float measurement_noise )

Initialize a 1D Kalman filter instance.

Sets the initial state and noise parameters for the filter.

Larger Q values let the filter adapt faster to changes. Larger R values make the filter trust measurements less.

Parameters
kfPointer to the filter instance to initialize.
init_pressureInitial estimate for the state.
process_noiseProcess noise covariance (Q).
measurement_noiseMeasurement noise covariance (R).
Returns
esp_err_t ESP_OK on success.

< esp_err_t value indicating success (no error)

Here is the caller graph for this function:

◆ kalman1d_update()

float kalman1d_update ( kalman1d_t * kf,
float z )

Perform a single Kalman filter update with a new measurement.

Applies the predict and update steps of the Kalman filter:

  1. Predict the new state estimate and error covariance.
  2. Compute the Kalman gain.
  3. Update the state estimate and error covariance with the incoming measurement.
Parameters
kfPointer to the filter instance.
zNew measurement.
Returns
float Updated state estimate.
Here is the caller graph for this function: