- 3.0.2 optimal control module.
SteadyStateKalmanFilter.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 #include "../lqr/riccati/DARE.hpp"
9 #include "EstimatorBase.h"
10 #include "LinearMeasurementModel.h"
11 
12 namespace ct {
13 namespace optcon {
14 
15 template <size_t STATE_DIM, typename SCALAR>
16 struct SteadyStateKalmanFilterSettings;
17 
26 template <size_t STATE_DIM, size_t CONTROL_DIM, size_t OUTPUT_DIM, typename SCALAR = double>
27 class SteadyStateKalmanFilter final : public EstimatorBase<STATE_DIM, CONTROL_DIM, OUTPUT_DIM, SCALAR>
28 {
29 public:
30  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
31 
33  using typename Base::control_vector_t;
34  using typename Base::output_matrix_t;
35  using typename Base::output_vector_t;
36  using typename Base::state_matrix_t;
37  using typename Base::state_vector_t;
38 
42  const state_matrix_t& Q,
43  const output_matrix_t& R,
44  const state_vector_t& x0 = state_vector_t::Zero(),
45  size_t maxDAREIterations = 1000);
46 
51 
54  const ct::core::Time& dt,
55  const ct::core::Time& t) override;
56 
58  const state_vector_t& update(const output_vector_t& y, const ct::core::Time& dt, const ct::core::Time& t) override;
59 
61  void setMaxDAREIterations(size_t maxDAREIterations);
62 
63 private:
64  size_t maxDAREIterations_;
65  state_matrix_t P_;
66  state_matrix_t A_;
67  output_matrix_t R_;
68  state_matrix_t Q_;
69 };
70 
71 } // namespace optcon
72 } // namespace ct
ct::core::OutputVector< OUTPUT_DIM, SCALAR > output_vector_t
Definition: EstimatorBase.h:29
ct::core::StateMatrix< STATE_DIM, SCALAR > state_matrix_t
Definition: EstimatorBase.h:28
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
ct::core::OutputMatrix< OUTPUT_DIM, SCALAR > output_matrix_t
Definition: EstimatorBase.h:30
ct::core::StateVector< STATE_DIM, SCALAR > state_vector_t
Definition: EstimatorBase.h:27
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
Steady State Kalman Filter is a time invariant linear estimator. It starts with the same update rule ...
Definition: SteadyStateKalmanFilter.h:27
System model is an interface that encapsulates the integrator to be able to propagate the system...
Definition: SystemModelBase.h:21
Estimator base.
Definition: EstimatorBase.h:21
void setMaxDAREIterations(size_t maxDAREIterations)
Limit number of iterations of the DARE solver.
Definition: SteadyStateKalmanFilter-impl.h:69
StateVector< state_dim > x0
Definition: ConstrainedNLOCTest.cpp:14
SteadyStateKalmanFilter(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(), size_t maxDAREIterations=1000)
Constructor.
Definition: SteadyStateKalmanFilter-impl.h:12
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: SteadyStateKalmanFilter-impl.h:37
Settings for setting up a SteadyStateKF.
Definition: FilterSettings.h:88
ct::core::ControlVector< CONTROL_DIM, SCALAR > control_vector_t
Definition: EstimatorBase.h:26
double Time
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: SteadyStateKalmanFilter-impl.h:47