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 
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_
bool initialize()
initialize the predictor
Eigen::VectorXd ControlVector
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)
SystemDynamicsInterface::Ptr _dynamics
OneStepPredictor()=default
Default constructor.
std::shared_ptr< NumericalIntegratorExplicitInterface > Ptr
NumericalIntegratorExplicitInterface::Ptr _integrator
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:192
void setIntegrator(NumericalIntegratorExplicitInterface::Ptr integrator)
Set a numerical integrator for continuous-time dynamics.
void setSystemDynamics(SystemDynamicsInterface::Ptr dynamics)
Set the system dynamics of the simulated plant.
std::shared_ptr< SystemDynamicsInterface > Ptr


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:07:06