Package edu.wpi.first.math.estimator
Class KalmanFilterLatencyCompensator<S extends Num,I extends Num,O extends Num>
java.lang.Object
edu.wpi.first.math.estimator.KalmanFilterLatencyCompensator<S,I,O>
- Type Parameters:
S- The number of states.I- The number of inputs.O- The number of outputs.
public class KalmanFilterLatencyCompensator<S extends Num,I extends Num,O extends Num>
extends Object
This class incorporates time-delayed measurements into a Kalman filter's state estimate.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classThis class contains all the information about our observer at a given time. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserverState(KalmanTypeFilter<S, I, O> observer, Matrix<I, N1> u, Matrix<O, N1> localY, double timestampSeconds) Add past observer states to the observer snapshots list.<R extends Num>
voidapplyPastGlobalMeasurement(Nat<R> rows, KalmanTypeFilter<S, I, O> observer, double nominalDtSeconds, Matrix<R, N1> y, BiConsumer<Matrix<I, N1>, Matrix<R, N1>> globalMeasurementCorrect, double timestampSeconds) Add past global measurements (such as from vision)to the estimator.voidreset()Clears the observer snapshot buffer.
-
Method Details
-
reset
Clears the observer snapshot buffer. -
addObserverState
public void addObserverState(KalmanTypeFilter<S, I, O> observer, Matrix<I, N1> u, Matrix<O, N1> localY, double timestampSeconds) Add past observer states to the observer snapshots list.- Parameters:
observer- The observer.u- The input at the timestamp.localY- The local output at the timestamptimestampSeconds- The timestamp of the state.
-
applyPastGlobalMeasurement
public <R extends Num> void applyPastGlobalMeasurement(Nat<R> rows, KalmanTypeFilter<S, I, O> observer, double nominalDtSeconds, Matrix<R, N1> y, BiConsumer<Matrix<I, N1>, Matrix<R, N1>> globalMeasurementCorrect, double timestampSeconds) Add past global measurements (such as from vision)to the estimator.- Type Parameters:
R- The rows in the global measurement vector.- Parameters:
rows- The rows in the global measurement vector.observer- The observer to apply the past global measurement.nominalDtSeconds- The nominal timestep.y- The measurement.globalMeasurementCorrect- The function take calls correct() on the observer.timestampSeconds- The timestamp of the measurement.
-