benchmark_task_increasing_n_open_loop.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_BENCHMARK_TASK_INCREASING_N_OPEN_LOOP_H_
26 #define SRC_TASKS_INCLUDE_CORBO_TASKS_BENCHMARK_TASK_INCREASING_N_OPEN_LOOP_H_
27 
29 
31 
32 #include <memory>
33 #include <string>
34 
35 namespace corbo {
36 
48 class BenchmarkTaskIncreasingHorizonOpenLoop : public TaskInterface
49 {
50  public:
51  using Ptr = std::shared_ptr<BenchmarkTaskIncreasingHorizonOpenLoop>;
52 
55 
56  // implements interface method
57  TaskInterface::Ptr getInstance() const override { return std::make_shared<BenchmarkTaskIncreasingHorizonOpenLoop>(); }
58 
59  // implements interface method
60  void performTask(Environment& environment, SignalTargetInterface* signal_target = nullptr, std::string* msg = nullptr,
61  const std::string& ns = "") override;
62 
63  // implements interface method
64  bool verify(const Environment& environment, std::string* msg = nullptr) const override;
65 
66  // implements interface method
67  void getAvailableSignals(const Environment& environment, SignalTargetInterface& signal_target, const std::string& ns = "") const override;
68 
69  // implements interface method
70  void reset() override;
71 
72 #ifdef MESSAGE_SUPPORT
73  void toMessage(messages::BenchmarkTaskIncreasingHorizonOpenLoop& message) const;
74  void fromMessage(const messages::BenchmarkTaskIncreasingHorizonOpenLoop& message, std::stringstream* issues = nullptr);
75 
76  // implements interface method
77  void toMessage(messages::Task& message) const override { toMessage(*message.mutable_benchmark_increasing_n_open_loop()); }
78  // implements interface method
79  void fromMessage(const messages::Task& message, std::stringstream* issues = nullptr) override
80  {
81  fromMessage(message.benchmark_increasing_n_open_loop(), issues);
82  }
83 #endif
84 
85  private:
87 
88  int _n_start = 1;
89  int _n_end = 50;
90  int _n_step = 1;
91  int _repetitions = 1;
92  double _initial_tf = 1.0;
93  double _wait_time = 1e-6;
95  bool _publish_task_signals = false;
96 };
97 
99 
100 } // namespace corbo
101 
102 #endif // SRC_TASKS_INCLUDE_CORBO_TASKS_BENCHMARK_TASK_INCREASING_N_OPEN_LOOP_H_
corbo::TaskInterface::Ptr
std::shared_ptr< TaskInterface > Ptr
Definition: task_interface.h:107
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::reset
void reset() override
Reset task state.
Definition: benchmark_task_increasing_n_open_loop.cpp:183
corbo
Definition: communication/include/corbo-communication/utilities.h:37
corbo::OpenLoopControlTask::Ptr
std::shared_ptr< OpenLoopControlTask > Ptr
Definition: task_open_loop_control.h:96
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::Ptr
std::shared_ptr< BenchmarkTaskIncreasingHorizonOpenLoop > Ptr
Definition: benchmark_task_increasing_n_open_loop.h:95
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::performTask
void performTask(Environment &environment, SignalTargetInterface *signal_target=nullptr, std::string *msg=nullptr, const std::string &ns="") override
Perform task.
Definition: benchmark_task_increasing_n_open_loop.cpp:73
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_repetitions
int _repetitions
Definition: benchmark_task_increasing_n_open_loop.h:135
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_n_end
int _n_end
Definition: benchmark_task_increasing_n_open_loop.h:133
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_n_step
int _n_step
Definition: benchmark_task_increasing_n_open_loop.h:134
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::verify
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.
Definition: benchmark_task_increasing_n_open_loop.cpp:150
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::getInstance
TaskInterface::Ptr getInstance() const override
Return a newly created shared instance of the implemented class.
Definition: benchmark_task_increasing_n_open_loop.h:101
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_n_start
int _n_start
Definition: benchmark_task_increasing_n_open_loop.h:132
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::BenchmarkTaskIncreasingHorizonOpenLoop
BenchmarkTaskIncreasingHorizonOpenLoop()
Default constructor.
Definition: benchmark_task_increasing_n_open_loop.cpp:66
task_open_loop_control.h
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_initial_tf
double _initial_tf
Definition: benchmark_task_increasing_n_open_loop.h:136
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_open_loop_task
OpenLoopControlTask::Ptr _open_loop_task
Definition: benchmark_task_increasing_n_open_loop.h:130
task_interface.h
corbo::BenchmarkTaskIncreasingHorizonOpenLoop
BenchmarkTaskIncreasingHorizonOpenLoop.
Definition: benchmark_task_increasing_n_open_loop.h:70
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_shooting_num_u_per_interval
int _shooting_num_u_per_interval
Definition: benchmark_task_increasing_n_open_loop.h:138
FACTORY_REGISTER_TASK
#define FACTORY_REGISTER_TASK(type)
Definition: task_interface.h:139
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_publish_task_signals
bool _publish_task_signals
Definition: benchmark_task_increasing_n_open_loop.h:139
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::getAvailableSignals
void getAvailableSignals(const Environment &environment, SignalTargetInterface &signal_target, const std::string &ns="") const override
Retrieve available signals from the task.
Definition: benchmark_task_increasing_n_open_loop.cpp:68
corbo::BenchmarkTaskIncreasingHorizonOpenLoop::_wait_time
double _wait_time
Definition: benchmark_task_increasing_n_open_loop.h:137


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