WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
warpos::EkfMeasurementUpdate< N, M, O > Class Template Reference

Generic, templated EKF measurement update class. More...

#include <EkfMeasurementUpdate.hpp>

Public Member Functions

 EkfMeasurementUpdate (Measurements< N, M, O > &measurement_ref)
 Constructor.
int16 generateResidual (floating_point time, const std::array< floating_point, N > &state_minus, const std::array< floating_point, O > &obs_state, const std::array< floating_point, M > &measurement, std::array< floating_point, M > *residual)
 Function to generate the residual from the current state.
int16 runUpdate (floating_point time, const std::array< floating_point, N > &state_minus, const clockwerk::Matrix< N, N > &cov_minus, const std::array< floating_point, O > &obs_state, const std::array< floating_point, M > &residual, std::array< floating_point, N > *state_plus, clockwerk::Matrix< N, N > *cov_plus)
 Function to perform state measurement update in EKF.
void setMeasurementNoiseMatrix (const clockwerk::Matrix< M, M > &R)
 Set the R matrix for the measurement update.

Detailed Description

template<uint32 N, uint32 M, uint32 O>
class warpos::EkfMeasurementUpdate< N, M, O >

Generic, templated EKF measurement update class.

This class performs an EKF measurement update using the current target state, an "observer state" which provides information (i.e. ground station information), and the associated measurement and H matrix functions. It requires three templated arguments, which are as follows: N - The number of target states estimated in the EKF M - The number of measurement states provided. Same as the number of noise states. O - The number of observer states used to support measurement generation

The measurement update is performed based on the Joseph formulation of the Kalman update for numerical stability. Symmetry is enforced every step.

The measurement update enforces positive diagonal on the covariance matrix prior to processing. If the matrix has any items below the minimum epsilon on the diagonal, the minimum epsilon is enforced.

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech / Alex Reynolds

Constructor & Destructor Documentation

◆ EkfMeasurementUpdate()

template<uint32 N, uint32 M, uint32 O>
warpos::EkfMeasurementUpdate< N, M, O >::EkfMeasurementUpdate ( Measurements< N, M, O > & measurement_ref)

Constructor.

Member Function Documentation

◆ generateResidual()

template<uint32 N, uint32 M, uint32 O>
int16 warpos::EkfMeasurementUpdate< N, M, O >::generateResidual ( floating_point time,
const std::array< floating_point, N > & state_minus,
const std::array< floating_point, O > & obs_state,
const std::array< floating_point, M > & measurement,
std::array< floating_point, M > * residual )

Function to generate the residual from the current state.

Parameters
[in]timeThe reference time
[in]state_minusThe system prior to measurement update
[in]obs_stateThe observer state ar the reference time
[in]measurementThe actual measurement derived from the sensors
[out]residualImplicit return of the difference (actual measurement - expected measurement)
Returns
Error code corresponding to success/failure

◆ runUpdate()

template<uint32 N, uint32 M, uint32 O>
int16 warpos::EkfMeasurementUpdate< N, M, O >::runUpdate ( floating_point time,
const std::array< floating_point, N > & state_minus,
const clockwerk::Matrix< N, N > & cov_minus,
const std::array< floating_point, O > & obs_state,
const std::array< floating_point, M > & residual,
std::array< floating_point, N > * state_plus,
clockwerk::Matrix< N, N > * cov_plus )

Function to perform state measurement update in EKF.

Parameters
[in]timeThe reference time
[in]state_minusThe system state prior to measurement update
[in]cov_minusThe system covariance prior to measurement update
[in]obs_stateThe observer state at the reference time
[in]residualThe difference (actual measurement - expected measurement)
[out]state_plusImplicit return of the state of the system after measurement update
[out]cov_plusImplicit return of the covariance of the system after measurement update
Returns
Error code corresponding to success/failure

◆ setMeasurementNoiseMatrix()

template<uint32 N, uint32 M, uint32 O>
void warpos::EkfMeasurementUpdate< N, M, O >::setMeasurementNoiseMatrix ( const clockwerk::Matrix< M, M > & R)
inline

Set the R matrix for the measurement update.

Parameters
RThe measurement noise matrix to set

The documentation for this class was generated from the following file: