task_closed_loop_control.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_TASKS_INCLUDE_CORBO_TASKS_TASK_CLOSED_LOOP_CONTROL_H_
26 #define SRC_TASKS_INCLUDE_CORBO_TASKS_TASK_CLOSED_LOOP_CONTROL_H_
27 
29 
32 
33 #include <memory>
34 #include <string>
35 
36 namespace corbo {
37 
51 {
52  public:
53  using Ptr = std::shared_ptr<ClosedLoopControlTask>;
54 
57 
58  // implements interface method
59  TaskInterface::Ptr getInstance() const override { return std::make_shared<ClosedLoopControlTask>(); }
60 
61  // implements interface method
62  void performTask(Environment& environment, SignalTargetInterface* signal_target = nullptr, std::string* msg = nullptr,
63  const std::string& ns = "") override;
64 
69 
70  // implements interface method
71  bool verify(const Environment& environment, std::string* msg = nullptr) const override;
72 
73  // implements interface method
74  void getAvailableSignals(const Environment& environment, SignalTargetInterface& signal_target, const std::string& ns = "") const override;
75 
76  // implements interface method
77  void reset() override;
78 
79 #ifdef MESSAGE_SUPPORT
80  void toMessage(messages::ClosedLoopControlTask& message) const;
81  void fromMessage(const messages::ClosedLoopControlTask& message, std::stringstream* issues = nullptr);
82 
83  // implements interface method
84  void toMessage(messages::Task& message) const override { toMessage(*message.mutable_closed_loop_control_task()); }
85  // implements interface method
86  void fromMessage(const messages::Task& message, std::stringstream* issues = nullptr) override
87  {
88  fromMessage(message.closed_loop_control_task(), issues);
89  }
90 
91 #endif
92 
93  private:
94  double _sim_time = 10.0;
95  double _dt = 0.1;
96  bool _realtime_sync = false;
97  bool _use_wall_time = false;
98  bool _compensate_dead_time = false;
99  bool _compensate_cpu_time = false;
100  double _min_dt = 0;
102 
105 
106  double _computation_delay = 0;
110 };
111 
113 
114 } // namespace corbo
115 
116 #endif // SRC_TASKS_INCLUDE_CORBO_TASKS_TASK_CLOSED_LOOP_CONTROL_H_
Standard environment for control tasks.
Definition: environment.h:49
ReferenceTrajectoryInterface::Ptr _xreference
FilterInterface::Ptr _computation_delay_filter
std::shared_ptr< FilterInterface > Ptr
std::shared_ptr< TaskInterface > Ptr
void setControlReference(ReferenceTrajectoryInterface::Ptr ureference)
Set control input reference trajectory.
Time Delay Object for Piecewise-Constant Signals.
Interface class for signal targets.
void performTask(Environment &environment, SignalTargetInterface *signal_target=nullptr, std::string *msg=nullptr, const std::string &ns="") override
Perform task.
void setStateReference(ReferenceTrajectoryInterface::Ptr xreference)
Set state reference trajectory.
void getAvailableSignals(const Environment &environment, SignalTargetInterface &signal_target, const std::string &ns="") const override
Retrieve available signals from the task.
constexpr const double CORBO_INF_DBL
Representation for infinity (double version)
bool verify(const Environment &environment, std::string *msg=nullptr) const override
Check if the environment and other settings satisfy all requirements for the given task...
void reset() override
Reset task state.
std::shared_ptr< ClosedLoopControlTask > Ptr
std::shared_ptr< ReferenceTrajectoryInterface > Ptr
ReferenceTrajectoryInterface::Ptr _ureference
TaskInterface::Ptr getInstance() const override
Return a newly created shared instance of the implemented class.
ClosedLoopControlTask()
Default constructor.
#define FACTORY_REGISTER_TASK(type)
Perform closed-loop control task.
Interface class for tasks.


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