1 #include "IteratedExtendedKalman.hh"
6 IteratedExtendedKalman::IteratedExtendedKalman()
7 : bUseStable_(false), maxIters_(20), iterEps_(1e-4)
17 : bUseStable_(bUseStable), maxIters_(maxIters), iterEps_(iterEps)
44 A_.
newsize(systemStateDim_, systemStateDim_);
87 const unsigned int index)
89 const unsigned int measurementDim = measurement.
size();
93 BIASASSERT(measurementDim != 0);
94 BIASASSERT(measurementDim == (
unsigned int)measureNoise.
num_cols());
95 BIASASSERT(measurementDim == (
unsigned int)measureNoise.
num_rows());
99 if (((
unsigned int)
H_.
num_rows() != measurementDim) ||
102 if (((
unsigned int)
V_.
num_rows() != measurementDim)||
126 for (
unsigned int i=0; i<
maxIters_; i++) {
127 delta_state =
state_ - state_iter;
144 update = delta_state + K*(measurement - measurePred -
H_*delta_state);
145 state_iter = state_iter + update;
150 if (update.NormL2() <
iterEps_)
break;
BIAS::Vector< double > statePost_
contains the corrected (a posteriori) system estimate
BIAS::Matrix< double > WT_
virtual void GetTransitionJacobian(const BIAS::Vector< double > &state, const BIAS::Vector< double > &control, BIAS::Matrix< double > &transJacobian, BIAS::Matrix< double > &transErrorJacobian)
Returns the jacobian matrices (by state and process noise) for state transition function.
double iterEps_
break update iteration if update improvement is smaller than iterEps
BIAS::Matrix< double > AT_
unsigned int maxIters_
number of maximal iterations for iterated update
Subscript num_cols() const
unsigned int processNoiseDim_
dimension of process noise
IteratedExtendedKalman()
Standard constructor.
void Update(const BIAS::Vector< double > &measurement, const BIAS::Matrix< double > &measureNoise, const unsigned int index)
Implememts the iterative update step using measurement and its covariance.
Matrix< T > Transpose() const
transpose function, storing data destination matrix
BIAS::Matrix< double > A_
derived state-trans. matrix and transposed
BIAS::Vector< double > state_
contains the actual system estimate
Matrix< T > & newsize(Subscript M, Subscript N)
BIAS::Matrix< double > covariancePost_
the covariance matrix corresponding to statePost_
BIAS::Matrix< double > covariancePrior_
the covariance matrix corresponding to statePrior_
void Init(const BIAS::Vector< double > &initialState, const BIAS::Matrix< double > &initialCov, const BIAS::Matrix< double > &processNoiseCov)
Initialize the kalman filter before using update/predict.
BIAS::Matrix< double > HT_
void Predict(const BIAS::Vector< double > &control)
Implements a single preditcion step (with respect to the control parameters – u[k] in [1])...
BIAS::Matrix< double > W_
state-trans. error jacobian and transposed
BIAS::Matrix< double > V_
measurement error jacobian for measurement model and its transpose
BIAS::Vector< double > statePrior_
contains the last prediction (a priori/initial) system estimate
void SetIdentity()
Converts matrix to identity matrix.
BIAS::Matrix< double > VT_
BIAS::Matrix< double > Identity_
identity matrix frequently used in Update
unsigned int systemStateDim_
dimension of state space
BIAS::Matrix< double > covariance_
the covariance matrix corresponding to state_
Matrix< double > Invert()
returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T
const bool bUseStable_
flag for using numerically more stable computations for update (higher computation effort) ...
virtual void StateTransition(const BIAS::Vector< double > &state, const BIAS::Vector< double > &control, BIAS::Vector< double > &prediction)
Implements the statetransition-function (f in [1]).
virtual void MeasurementPrediction(const BIAS::Vector< double > &state, BIAS::Vector< double > &measurePred, const unsigned int index=1)
Implements the measurement prediction function (h in [1])! Since more than one measurement is allowed...
BIAS::SVD svd_
needed for matrix inversion
Subscript num_rows() const
virtual void GetMeasureJacobian(const BIAS::Vector< double > &state, BIAS::Matrix< double > &measJacobian, BIAS::Matrix< double > &measErrorJacobian, const unsigned int index=1)
Returns the jacobian matrix of the measurement-function with respect to the state (H in [1]) as well ...
BIAS::Matrix< double > H_
measurement jacobian for measurement model and its transpose
BIAS::Matrix< double > Q_
system noise cov.