orwell 0.0.0
ParallelController.hpp
1/*
2 Copyright (c) Tobias Löw
3 Written by Tobias Löw <https://tobiloew.ch>
4
5 This file is part of orwell.
6
7 gafro is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3 as
9 published by the Free Software Foundation.
10
11 gafro is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with gafro. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <orwell/Controller.hpp>
23
24namespace orwell
25{
26
27 template <int dof>
29
30 template <int dof>
31 class TorqueController;
32
33 template <int dof>
35
43 template <int dof, template <int> class DerivedController>
44 class ParallelController : public DerivedController<dof>, private DerivedController<dof>::SharedGroup
45 {
46 public:
54 ParallelController(const sackmesser::Interface::Ptr &interface, const std::string &name);
55
59 virtual ~ParallelController();
60
66 Eigen::Vector<double, dof> computeCommand();
67
68 private:
70 std::vector<std::shared_ptr<DerivedController<dof>>> controllers_;
71 };
72
73 template <int dof>
75
76 template <int dof>
78
79} // namespace orwell
80
81#include <orwell/ParallelController.hxx>
82//
83#include <orwell/torque/TorqueController.hpp>
84#include <orwell/velocity/VelocityController.hpp>
85
86REGISTER_CLASS(orwell::TorqueController<7>, orwell::ParallelTorqueController<7>, "parallel_controller")
87// REGISTER_CLASS(orwell::VelocityController<7>, orwell::ParallelVelocityController<7>, "parallel_controller")
manages available controllers
invokes several controllers in parallel and combines their control command
Eigen::Vector< double, dof > computeCommand()
computation of the control command depending
ParallelController(const sackmesser::Interface::Ptr &interface, const std::string &name)
Controller using torque commands.
Controller using velocity commands.