Package edu.wpi.first.math.estimator
Interface KalmanTypeFilter<States extends Num,Inputs extends Num,Outputs extends Num>
- Type Parameters:
States
- The number of states.Inputs
- The number of inputs.Outputs
- The number of outputs.
- All Known Implementing Classes:
ExtendedKalmanFilter
,KalmanFilter
,UnscentedKalmanFilter
public interface KalmanTypeFilter<States extends Num,Inputs extends Num,Outputs extends Num>
Interface for Kalman filters for use with KalmanFilterLatencyCompensator.
-
Method Summary
Modifier and Type Method Description void
correct(Matrix<Inputs,N1> u, Matrix<Outputs,N1> y)
Correct the state estimate x-hat using the measurements in y.Matrix<States,States>
getP()
Returns the error covariance matrix.double
getP(int i, int j)
Returns an element of the error covariance matrix.Matrix<States,N1>
getXhat()
Returns the state estimate.double
getXhat(int i)
Returns an element of the state estimate.void
predict(Matrix<Inputs,N1> u, double dtSeconds)
Project the model into the future with a new control input u.void
reset()
Resets the observer.void
setP(Matrix<States,States> newP)
Sets the error covariance matrix.void
setXhat(int i, double value)
Sets an element of the state estimate.void
setXhat(Matrix<States,N1> xHat)
Sets the state estimate.
-
Method Details
-
getP
Returns the error covariance matrix.- Returns:
- The error covariance matrix.
-
getP
Returns an element of the error covariance matrix.- Parameters:
i
- The row.j
- The column.- Returns:
- An element of the error covariance matrix.
-
setP
Sets the error covariance matrix.- Parameters:
newP
- The error covariance matrix.
-
getXhat
Returns the state estimate.- Returns:
- The state estimate.
-
getXhat
Returns an element of the state estimate.- Parameters:
i
- The row.- Returns:
- An element of the state estimate.
-
setXhat
Sets the state estimate.- Parameters:
xHat
- The state estimate.
-
setXhat
Sets an element of the state estimate.- Parameters:
i
- The row.value
- The value.
-
reset
void reset()Resets the observer. -
predict
Project the model into the future with a new control input u.- Parameters:
u
- New control input from controller.dtSeconds
- Timestep for prediction.
-
correct
Correct the state estimate x-hat using the measurements in y.- Parameters:
u
- Same control input used in the predict step.y
- Measurement vector.
-