- 3.0.2 optimal control module.
|
Extended Kalman Filter implementation. For an algorithmic overview, see also https://en.wikipedia.org/wiki/Extended_Kalman_filter. More...
#include <ExtendedKalmanFilter.h>
Public Types | |
using | Base = EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR > |
using | control_vector_t = ct::core::ControlVector< CONTROL_DIM, SCALAR > |
using | output_matrix_t = ct::core::OutputMatrix< OUTPUT_DIM, SCALAR > |
using | output_vector_t = ct::core::OutputVector< OUTPUT_DIM, SCALAR > |
using | state_matrix_t = ct::core::StateMatrix< STATE_DIM, SCALAR > |
using | state_vector_t = ct::core::StateVector< STATE_DIM, SCALAR > |
Public Types inherited from ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR > | |
using | control_vector_t = ct::core::ControlVector< CONTROL_DIM, SCALAR > |
using | state_vector_t = ct::core::StateVector< STATE_DIM, SCALAR > |
using | state_matrix_t = ct::core::StateMatrix< STATE_DIM, SCALAR > |
using | output_vector_t = ct::core::OutputVector< OUTPUT_DIM, SCALAR > |
using | output_matrix_t = ct::core::OutputMatrix< OUTPUT_DIM, SCALAR > |
Public Member Functions | |
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. More... | |
ExtendedKalmanFilter (std::shared_ptr< SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >> f, std::shared_ptr< LinearMeasurementModel< OUTPUT_DIM, STATE_DIM, SCALAR >> h, const ExtendedKalmanFilterSettings< STATE_DIM, SCALAR > &ekf_settings) | |
Constructor from settings. More... | |
const state_vector_t & | predict (const control_vector_t &u, const ct::core::Time &dt, const ct::core::Time &t) override |
Estimator predict method. More... | |
const state_vector_t & | update (const output_vector_t &y, const ct::core::Time &dt, const ct::core::Time &t) override |
Estimator update method. More... | |
const state_matrix_t & | getCovarianceMatrix () |
void | setQ (const state_matrix_t &Q) |
update Q matrix More... | |
void | setR (const output_matrix_t &R) |
update R matrix More... | |
Public Member Functions inherited from ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR > | |
EstimatorBase (std::shared_ptr< SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >> f, std::shared_ptr< LinearMeasurementModel< OUTPUT_DIM, STATE_DIM, SCALAR >> h, const state_vector_t &x0=state_vector_t::Zero()) | |
Constructor. More... | |
EstimatorBase (const EstimatorBase &arg) | |
Copy constructor. More... | |
virtual | ~EstimatorBase ()=default |
void | setSystemModel (std::shared_ptr< SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >> f) |
update the system model More... | |
void | setMeasurementModel (std::shared_ptr< LinearMeasurementModel< OUTPUT_DIM, STATE_DIM, SCALAR >> h) |
update the measurement model More... | |
const state_vector_t & | getEstimate () const |
Estimate getter. More... | |
void | setEstimate (const state_vector_t &x) |
Estimate setter. More... | |
Protected Attributes | |
state_matrix_t | Q_ |
Filter Q matrix. More... | |
output_matrix_t | R_ |
Filter R matrix. More... | |
state_matrix_t | P_ |
Covariance estimate. More... | |
Protected Attributes inherited from ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR > | |
std::shared_ptr< SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR > > | f_ |
System model for propagating the system. More... | |
std::shared_ptr< LinearMeasurementModel< OUTPUT_DIM, STATE_DIM, SCALAR > > | h_ |
Observation model used to calculate the output error. More... | |
state_vector_t | x_est_ |
State estimate. More... | |
Extended Kalman Filter implementation. For an algorithmic overview, see also https://en.wikipedia.org/wiki/Extended_Kalman_filter.
using ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::Base = EstimatorBase<STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR> |
using ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::control_vector_t = ct::core::ControlVector<CONTROL_DIM, SCALAR> |
using ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::output_matrix_t = ct::core::OutputMatrix<OUTPUT_DIM, SCALAR> |
using ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::output_vector_t = ct::core::OutputVector<OUTPUT_DIM, SCALAR> |
using ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::state_matrix_t = ct::core::StateMatrix<STATE_DIM, SCALAR> |
using ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::state_vector_t = ct::core::StateVector<STATE_DIM, SCALAR> |
ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::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.
ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::ExtendedKalmanFilter | ( | std::shared_ptr< SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >> | f, |
std::shared_ptr< LinearMeasurementModel< OUTPUT_DIM, STATE_DIM, SCALAR >> | h, | ||
const ExtendedKalmanFilterSettings< STATE_DIM, SCALAR > & | ekf_settings | ||
) |
Constructor from settings.
|
overridevirtual |
Estimator predict method.
Implements ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >.
References dt, ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::f_, ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::P_, ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::Q_, t, u, and ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::x_est_.
Referenced by main().
|
overridevirtual |
Estimator update method.
Implements ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >.
References ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::h_, ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::P_, ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::R_, t, and ct::optcon::EstimatorBase< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::x_est_.
Referenced by main().
auto ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::getCovarianceMatrix | ( | ) |
References ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::P_.
Referenced by main().
|
inline |
update Q matrix
References ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::Q_.
|
inline |
update R matrix
References ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::R_.
|
protected |
|
protected |
|
protected |
Covariance estimate.
Referenced by ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::getCovarianceMatrix(), ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::predict(), and ct::optcon::ExtendedKalmanFilter< STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR >::update().