one_step_predictor.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2020,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  *
22  * Authors: Christoph Rösmann
23  *********************************************************************/
24 
25 #ifndef SRC_SYSTEMS_INCLUDE_CORBO_SYSTEMS_ONE_STEP_PREDICTOR_H_
26 #define SRC_SYSTEMS_INCLUDE_CORBO_SYSTEMS_ONE_STEP_PREDICTOR_H_
27 
31 
32 #ifdef MESSAGE_SUPPORT
33 #include <corbo-communication/messages/systems/one_step_predictor.pb.h>
34 #endif
35 
36 #include <memory>
37 
38 namespace corbo {
39 
49 class OneStepPredictor
50 {
51  public:
52  using StateVector = Eigen::VectorXd;
53  using ControlVector = Eigen::VectorXd;
54 
56  OneStepPredictor() = default;
57 
58  double getDeadTime();
59 
61  bool initialize();
62 
64  void predict(const Eigen::Ref<const StateVector>& x0, std::vector<std::pair<double, ControlVector>> u_seq, double dt, Eigen::Ref<StateVector> x1);
65 
70 
71 #ifdef MESSAGE_SUPPORT
72  virtual void toMessage(messages::OneStepPredictor& message) const;
75  virtual void fromMessage(const messages::OneStepPredictor& message, std::stringstream* issues = nullptr);
76 #endif
77 
78  private:
81 
82  bool _initialized = false;
83 };
84 
85 } // namespace corbo
86 
87 #endif // SRC_SYSTEMS_INCLUDE_CORBO_SYSTEMS_ONE_STEP_PREDICTOR_H_
system_dynamics_interface.h
corbo::OneStepPredictor::StateVector
Eigen::VectorXd StateVector
Definition: one_step_predictor.h:96
integrator_interface.h
corbo
Definition: communication/include/corbo-communication/utilities.h:37
corbo::NumericalIntegratorExplicitInterface::Ptr
std::shared_ptr< NumericalIntegratorExplicitInterface > Ptr
Definition: integrator_interface.h:205
corbo::OneStepPredictor::initialize
bool initialize()
initialize the predictor
Definition: one_step_predictor.cpp:55
corbo::OneStepPredictor::predict
void predict(const Eigen::Ref< const StateVector > &x0, std::vector< std::pair< double, ControlVector >> u_seq, double dt, Eigen::Ref< StateVector > x1)
Predict x1 using t0, x0, u and dt (alias between x0 and x1 allowed)
Definition: one_step_predictor.cpp:64
corbo::OneStepPredictor::setIntegrator
void setIntegrator(NumericalIntegratorExplicitInterface::Ptr integrator)
Set a numerical integrator for continuous-time dynamics.
Definition: one_step_predictor.h:113
time_value_buffer.h
corbo::SystemDynamicsInterface::Ptr
std::shared_ptr< SystemDynamicsInterface > Ptr
Definition: system_dynamics_interface.h:91
corbo::OneStepPredictor::OneStepPredictor
OneStepPredictor()=default
Default constructor.
Eigen::Ref
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:192
corbo::OneStepPredictor::ControlVector
Eigen::VectorXd ControlVector
Definition: one_step_predictor.h:97
corbo::OneStepPredictor::_dynamics
SystemDynamicsInterface::Ptr _dynamics
Definition: one_step_predictor.h:123
corbo::OneStepPredictor::getDeadTime
double getDeadTime()
Definition: one_step_predictor.cpp:53
corbo::OneStepPredictor::_integrator
NumericalIntegratorExplicitInterface::Ptr _integrator
Definition: one_step_predictor.h:124
corbo::OneStepPredictor::setSystemDynamics
void setSystemDynamics(SystemDynamicsInterface::Ptr dynamics)
Set the system dynamics of the simulated plant.
Definition: one_step_predictor.cpp:102
corbo::OneStepPredictor::_initialized
bool _initialized
Definition: one_step_predictor.h:126


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:58