Unscented Kalman Filter
This package implements Unscented Kalman Filter also known as Sigma-point filter.
- type Config
- type SigmaPoints
- type UKF
- func (k *UKF) Cov() mat.Symmetric
- func (k *UKF) Gain() mat.Matrix
- func (k *UKF) GenSigmaPoints(x mat.Vector) (*SigmaPoints, error)
- func (k *UKF) Model() filter.Model
- func (k *UKF) OutputNoise() filter.Noise
- func (k *UKF) Predict(x, u mat.Vector) (filter.Estimate, error)
- func (k *UKF) Run(x, u, z mat.Vector) (filter.Estimate, error)
- func (k *UKF) SetCov(cov mat.Symmetric) error
- func (k *UKF) StateNoise() filter.Noise
- func (k *UKF) Update(x, u, z mat.Vector) (filter.Estimate, error)
Config contains UKF [unitless] configuration parameters
type SigmaPoints ¶
SigmaPoints represents UKF sigma points and their covariance
UKF is Unscented (a.k.a. Sigma Point) Kalman Filter
New creates new UKF and returns it. It accepts the following parameters: - m: dynamical system model - init: initial condition of the filter - q: state a.k.a. process noise - r: output a.k.a. measurement noise - c: filter configuration It returns error if either of the following conditions is met: - invalid model is given: model dimensions must be positive integers - invalid state or output noise is given: noise covariance must either be nil or match the model dimensions - invalid sigma points parameters (alpha, beta, kappa) are supplied - sigma points fail to be generated: due to covariance SVD factorizations failure
func (*UKF) GenSigmaPoints ¶
GenSigmaPoints generates UKF sigma points around x and returns them. It returns error if it fails to generate new sigma points due to covariance SVD facrtorization failure.
Predict calculates the next system state given the state x and input u and returns its estimate. It first generates new sigma points around x and then attempts to propagate them to the next step. It returns error if it either fails to generate or propagate the sigma points (and x) to the next step.
Run runs one step of UKF for given state x, input u and measurement z. It corrects system state x using measurement z and returns new system estimate. It returns error if it either fails to propagate or correct state x or UKF sigma points.
SetCov sets UKF covariance matrix to cov. It returns error if either cov is nil or its dimensions are not the same as UKF covariance dimensions.