orwell 0.0.0
ControllerManager.hxx
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 <sackmesser/Configurations.hpp>
23//
24#include <orwell/ControllerManager.hpp>
25//
26#include <orwell/ParallelController.hpp>
27
28namespace orwell
29{
30
31 template <int dof>
32 ControllerManager<dof>::ControllerManager(const sackmesser::Interface::Ptr &interface, const typename RobotModel<dof>::Ptr &robot_model,
33 const std::string &name)
34 : TorqueController<dof>::SharedGroup(interface, name + "/torque_controller"), //
35 VelocityController<dof>::SharedGroup(interface, name + "/velocity_controller"), //
36 PositionController<dof>::SharedGroup(interface, name + "/position_controller"), //
37 robot_model_(robot_model)
38 {
40 [this](typename TorqueController<dof>::Ptr controller) { controller->setRobotModel(robot_model_); });
41
43 [this](typename VelocityController<dof>::Ptr controller) { controller->setRobotModel(robot_model_); });
44 }
45
46 template <int dof>
48
49 template <int dof>
54
55 template <int dof>
60
61 template <int dof>
66
67} // namespace orwell
manages available controllers
VelocityController< dof >::Ptr getVelocityController(const std::string &name)
obtain a specific VelocityController
ControllerManager(const sackmesser::Interface::Ptr &interface, const typename RobotModel< dof >::Ptr &robot_model, const std::string &name="controller_manager")
loads configuration parameters
TorqueController< dof >::Ptr getTorqueController(const std::string &name)
obtain a specific TorqueController
PositionController< dof >::Ptr getPositionController(const std::string &name)
obtain a specific PositionController
void setRobotModel(const typename RobotModel< dof >::Ptr &robot_model)
set the RobotModel
Controller using position commands.
std::shared_ptr< PositionController > Ptr
typedef
std::shared_ptr< RobotModel > Ptr
typedef
Controller using torque commands.
std::shared_ptr< TorqueController > Ptr
typedef
Controller using velocity commands.
std::shared_ptr< VelocityController > Ptr
typedef