11 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
size_t OUTPUT_DIM,
typename SCALAR>
19 :
Base(f, h, x0), Q_(Q), R_(R), P_(P0)
23 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
size_t OUTPUT_DIM,
typename SCALAR>
28 :
Base(f, h, ekf_settings.
x0),
Q_(ekf_settings.Q),
R_(ekf_settings.R),
P_(ekf_settings.P0)
32 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
size_t OUTPUT_DIM,
typename SCALAR>
44 P_ = (dFdx *
P_ * dFdx.transpose()) + dFdv * (
dt *
Q_) * dFdv.transpose();
53 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
size_t OUTPUT_DIM,
typename SCALAR>
63 const Eigen::Matrix<SCALAR, STATE_DIM, OUTPUT_DIM> K =
64 P_ * dHdx.transpose() * (dHdx *
P_ * dHdx.transpose() + dHdw * (
R_)*dHdw.transpose()).inverse();
67 this->
x_est_ += K * (y - this->
h_->computeMeasurement(this->
x_est_));
70 P_ -= (K * dHdx *
P_).eval();
75 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
size_t OUTPUT_DIM,
typename SCALAR>
std::shared_ptr< SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR > > f_
System model for propagating the system.
Definition: EstimatorBase.h:64
const state_vector_t & update(const output_vector_t &y, const ct::core::Time &dt, const ct::core::Time &t) override
Estimator update method.
Definition: ExtendedKalmanFilter-impl.h:54
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
output_matrix_t R_
Filter R matrix.
Definition: ExtendedKalmanFilter.h:68
std::shared_ptr< LinearMeasurementModel< OUTPUT_DIM, STATE_DIM, SCALAR > > h_
Observation model used to calculate the output error.
Definition: EstimatorBase.h:67
clear all close all load ct GNMSLog0 mat reformat t
Definition: gnmsPlot.m:6
const double dt
Definition: LQOCSolverTiming.cpp:18
Linear Measurement Model is an interface for linear measurement models most commonly used in practice...
Definition: LinearMeasurementModel.h:23
state_vector_t x_est_
State estimate.
Definition: EstimatorBase.h:70
ExtendedKalmanFilter(std::shared_ptr< SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >> f, std::shared_ptr< LinearMeasurementModel< OUTPUT_DIM, STATE_DIM, SCALAR >> h, const state_matrix_t &Q, const output_matrix_t &R, const state_vector_t &x0=state_vector_t::Zero(), const state_matrix_t &P0=state_matrix_t::Zero())
Constructor.
Definition: ExtendedKalmanFilter-impl.h:12
state_matrix_t P_
Covariance estimate.
Definition: ExtendedKalmanFilter.h:71
System model is an interface that encapsulates the integrator to be able to propagate the system...
Definition: SystemModelBase.h:21
Settings for setting up an ExtendedKF.
Definition: ExtendedKalmanFilter.h:14
const state_matrix_t & getCovarianceMatrix()
Definition: ExtendedKalmanFilter-impl.h:76
Estimator base.
Definition: EstimatorBase.h:21
StateVector< state_dim > x0
Definition: ConstrainedNLOCTest.cpp:14
const state_vector_t & predict(const control_vector_t &u, const ct::core::Time &dt, const ct::core::Time &t) override
Estimator predict method.
Definition: ExtendedKalmanFilter-impl.h:33
state_matrix_t Q_
Filter Q matrix.
Definition: ExtendedKalmanFilter.h:65