WPILibC++ 2024.3.2
frc::KalmanFilterLatencyCompensator< States, Inputs, Outputs, KalmanFilterType > Class Template Reference

This class incorporates time-delayed measurements into a Kalman filter's state estimate. More...

#include <frc/estimator/KalmanFilterLatencyCompensator.h>

Classes

struct  ObserverSnapshot
 This class contains all the information about our observer at a given time. More...
 

Public Member Functions

void Reset ()
 Clears the observer snapshot buffer. More...
 
void AddObserverState (const KalmanFilterType &observer, Vectord< Inputs > u, Vectord< Outputs > localY, units::second_t timestamp)
 Add past observer states to the observer snapshots list. More...
 
template<int Rows>
void ApplyPastGlobalMeasurement (KalmanFilterType *observer, units::second_t nominalDt, Vectord< Rows > y, std::function< void(const Vectord< Inputs > &u, const Vectord< Rows > &y)> globalMeasurementCorrect, units::second_t timestamp)
 Add past global measurements (such as from vision)to the estimator. More...
 

Detailed Description

template<int States, int Inputs, int Outputs, typename KalmanFilterType>
class frc::KalmanFilterLatencyCompensator< States, Inputs, Outputs, KalmanFilterType >

This class incorporates time-delayed measurements into a Kalman filter's state estimate.

Template Parameters
StatesThe number of states.
InputsThe number of inputs.
OutputsThe number of outputs.

Member Function Documentation

◆ AddObserverState()

template<int States, int Inputs, int Outputs, typename KalmanFilterType >
void frc::KalmanFilterLatencyCompensator< States, Inputs, Outputs, KalmanFilterType >::AddObserverState ( const KalmanFilterType &  observer,
Vectord< Inputs >  u,
Vectord< Outputs >  localY,
units::second_t  timestamp 
)
inline

Add past observer states to the observer snapshots list.

Parameters
observerThe observer.
uThe input at the timestamp.
localYThe local output at the timestamp
timestampThe timesnap of the state.

◆ ApplyPastGlobalMeasurement()

template<int States, int Inputs, int Outputs, typename KalmanFilterType >
template<int Rows>
void frc::KalmanFilterLatencyCompensator< States, Inputs, Outputs, KalmanFilterType >::ApplyPastGlobalMeasurement ( KalmanFilterType *  observer,
units::second_t  nominalDt,
Vectord< Rows >  y,
std::function< void(const Vectord< Inputs > &u, const Vectord< Rows > &y)>  globalMeasurementCorrect,
units::second_t  timestamp 
)
inline

Add past global measurements (such as from vision)to the estimator.

Parameters
observerThe observer to apply the past global measurement.
nominalDtThe nominal timestep.
yThe measurement.
globalMeasurementCorrectThe function take calls correct() on the observer.
timestampThe timestamp of the measurement.

◆ Reset()

template<int States, int Inputs, int Outputs, typename KalmanFilterType >
void frc::KalmanFilterLatencyCompensator< States, Inputs, Outputs, KalmanFilterType >::Reset ( )
inline

Clears the observer snapshot buffer.


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