task_open_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_OPEN_LOOP_CONTROL_H_
26 #define SRC_TASKS_INCLUDE_CORBO_TASKS_TASK_OPEN_LOOP_CONTROL_H_
27 
29 
30 #include <memory>
31 #include <string>
32 
33 namespace corbo {
34 
50 {
51  public:
52  using Ptr = std::shared_ptr<OpenLoopControlTask>;
53 
56 
57  // implements interface method
58  TaskInterface::Ptr getInstance() const override { return std::make_shared<OpenLoopControlTask>(); }
59 
60  // implements interface method
61  void performTask(Environment& environment, SignalTargetInterface* signal_target = nullptr, std::string* msg = nullptr,
62  const std::string& ns = "") override;
63 
68 
69  // implements interface method
70  bool verify(const Environment& environment, std::string* msg = nullptr) const override;
71 
72  // implements interface method
73  void getAvailableSignals(const Environment& environment, SignalTargetInterface& signal_target, const std::string& ns = "") const override;
74 
75  // implements interface method
76  void reset() override {}
77 
78 #ifdef MESSAGE_SUPPORT
79  void toMessage(messages::OpenLoopControlTask& message) const;
80  void fromMessage(const messages::OpenLoopControlTask& message, std::stringstream* issues = nullptr);
81 
82  // implements interface method
83  void toMessage(messages::Task& message) const override { toMessage(*message.mutable_open_loop_control_task()); }
84  // implements interface method
85  void fromMessage(const messages::Task& message, std::stringstream* issues = nullptr) override
86  {
87  fromMessage(message.open_loop_control_task(), issues);
88  }
89 #endif
90 
91  private:
92  double _dt = 0.1;
93  bool _realtime_sync = false;
96 };
97 
99 
100 } // namespace corbo
101 
102 #endif // SRC_TASKS_INCLUDE_CORBO_TASKS_TASK_OPEN_LOOP_CONTROL_H_
void setControlReference(ReferenceTrajectoryInterface::Ptr ureference)
Set control input reference trajectory.
Standard environment for control tasks.
Definition: environment.h:49
Perform open-loop control task.
ReferenceTrajectoryInterface::Ptr _xreference
OpenLoopControlTask()
Default constructor.
std::shared_ptr< TaskInterface > Ptr
ReferenceTrajectoryInterface::Ptr _ureference
void reset() override
Reset task state.
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 getAvailableSignals(const Environment &environment, SignalTargetInterface &signal_target, const std::string &ns="") const override
Retrieve available signals from the task.
TaskInterface::Ptr getInstance() const override
Return a newly created shared instance of the implemented class.
std::shared_ptr< ReferenceTrajectoryInterface > Ptr
void setStateReference(ReferenceTrajectoryInterface::Ptr xreference)
Set state reference trajectory.
#define FACTORY_REGISTER_TASK(type)
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...
Interface class for tasks.


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