ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
clockwerk::EkfMeasurementUpdate< T, N, M, O > Class Template Reference

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

#include <EkfMeasurementUpdate.hpp>

Collaboration diagram for clockwerk::EkfMeasurementUpdate< T, N, M, O >:

Public Member Functions

int generateResidualHMatrix (const std::array< T, N > &state, const std::array< T, O > &obs_state, const std::array< T, M > &measurement, CartesianVector< T, M > *residual, Matrix< T, M, N > *H)
 Function to generate residual and H matrix from current state.
 
int updateState (const CartesianVector< T, M > &residual, const Matrix< T, M, N > &H, const std::array< T, N > &state_minus, const Matrix< T, N, N > &cov_minus, const Matrix< T, M, M > &meas_cov, std::array< T, N > *state_plus, Matrix< T, N, N > *cov_plus)
 Function to perform state measurement update in EKF.
 
int calculateMeasurementCovariance (const Matrix< T, M, N > &H, const Matrix< T, N, N > &state_cov, const Matrix< T, M, M > &meas_cov, Matrix< T, M, M > *residual_cov)
 Function to generate covariance for measurement update evaluation.
 

Public Attributes

Measurements< T, N, M, O > * measurement_ptr = nullptr
 Pointer to the measurement class to calculate the estimated measurement given the current state of the object. The measurement class should be configured to use size.
 
Measurements< T, N, M *N, O > * H_ptr = nullptr
 Pointer to the measurement class to calculate the H matrix from the estimated spacecraft state.
 

Detailed Description

template<typename T, unsigned int N, unsigned int M, unsigned int O>
class clockwerk::EkfMeasurementUpdate< T, 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 O - The number of observer states used to support measurement generation

Two "functions" which take the form of a Measurements class must also be set: The function which generates measurements, and the function which generates the H matrix.

To run the measurement update, both functions are required. The first generates measurement residuals, and the second to actuall provide the state update

Member Function Documentation

◆ calculateMeasurementCovariance()

template<typename T , unsigned int N, unsigned int M, unsigned int O>
int clockwerk::EkfMeasurementUpdate< T, N, M, O >::calculateMeasurementCovariance ( const Matrix< T, M, N > &  H,
const Matrix< T, N, N > &  state_cov,
const Matrix< T, M, M > &  meas_cov,
Matrix< T, M, M > *  residual_cov 
)

Function to generate covariance for measurement update evaluation.

Parameters
HThe measurement sensitivity matrix for the system
state_covThe covariance in the system state
meas_covThe covariance associated with the measurement
residual_covImplicit return of the expected covariance of the residual
Returns
Error code corresponding to success/failure

◆ generateResidualHMatrix()

template<typename T , unsigned int N, unsigned int M, unsigned int O>
int clockwerk::EkfMeasurementUpdate< T, N, M, O >::generateResidualHMatrix ( const std::array< T, N > &  state,
const std::array< T, O > &  obs_state,
const std::array< T, M > &  measurement,
CartesianVector< T, M > *  residual,
Matrix< T, M, N > *  H 
)

Function to generate residual and H matrix from current state.

Parameters
stateThe current state of the filter
obs_stateAn observer state used to generate measurements
measurementThe actual measurement derived from sensors
residualImplicit return of the difference measurement - estimated measurement
HImplicit return of the measurement sensitivity matrix for the system
Returns
Error code corresponding to success/failure

◆ updateState()

template<typename T , unsigned int N, unsigned int M, unsigned int O>
int clockwerk::EkfMeasurementUpdate< T, N, M, O >::updateState ( const CartesianVector< T, M > &  residual,
const Matrix< T, M, N > &  H,
const std::array< T, N > &  state_minus,
const Matrix< T, N, N > &  cov_minus,
const Matrix< T, M, M > &  meas_cov,
std::array< T, N > *  state_plus,
Matrix< T, N, N > *  cov_plus 
)

Function to perform state measurement update in EKF.

Parameters
residualThe difference measurement - estimated measurement
HThe measurement sensitivity matrix for the system
state_minusThe system state prior to measurement update
cov_minusThe system covariance prior to measurement update
meas_covThe covariance of the measurement
state_plusImplicit return of the state of the system after measurement update
cov_plusImplicit return of the covariance of the system after measurement update
Returns
Error code corresponding to success/failure

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