1#include "controllers/ControllerFactory.hpp"
3#include "controllers/exceptions/InvalidControllerException.hpp"
4#include "controllers/impedance/Impedance.hpp"
5#include "controllers/impedance/VelocityImpedance.hpp"
6#include "controllers/impedance/Dissipative.hpp"
7#include "controllers/impedance/CompliantTwist.hpp"
15 CONTROLLER_TYPE type,
const std::list<std::shared_ptr<ParameterInterface>>& parameters,
unsigned int
18 case CONTROLLER_TYPE::IMPEDANCE:
19 return std::make_shared<impedance::Impedance<CartesianState>>(parameters);
20 case CONTROLLER_TYPE::VELOCITY_IMPEDANCE:
21 return std::make_shared<impedance::VelocityImpedance<CartesianState>>(parameters);
22 case CONTROLLER_TYPE::DISSIPATIVE:
23 return std::make_shared<impedance::Dissipative<CartesianState>>(
24 parameters, impedance::ComputationalSpaceType::FULL);
25 case CONTROLLER_TYPE::DISSIPATIVE_LINEAR:
26 return std::make_shared<impedance::Dissipative<CartesianState>>(
27 parameters, impedance::ComputationalSpaceType::LINEAR);
28 case CONTROLLER_TYPE::DISSIPATIVE_ANGULAR:
29 return std::make_shared<impedance::Dissipative<CartesianState>>(
30 parameters, impedance::ComputationalSpaceType::ANGULAR);
31 case CONTROLLER_TYPE::DISSIPATIVE_DECOUPLED:
32 return std::make_shared<impedance::Dissipative<CartesianState>>(
33 parameters, impedance::ComputationalSpaceType::DECOUPLED_TWIST);
34 case CONTROLLER_TYPE::COMPLIANT_TWIST:
35 return std::make_shared<impedance::CompliantTwist>(parameters);
37 case CONTROLLER_TYPE::NONE:
44 CONTROLLER_TYPE type,
const std::list<std::shared_ptr<ParameterInterface>>& parameters,
unsigned int dimensions
47 case CONTROLLER_TYPE::IMPEDANCE:
48 return std::make_shared<impedance::Impedance<JointState>>(parameters, dimensions);
49 case CONTROLLER_TYPE::VELOCITY_IMPEDANCE:
50 return std::make_shared<impedance::VelocityImpedance<JointState>>(parameters, dimensions);
51 case CONTROLLER_TYPE::DISSIPATIVE:
52 return std::make_shared<impedance::Dissipative<JointState>>(
53 parameters, impedance::ComputationalSpaceType::FULL, dimensions);
54 case CONTROLLER_TYPE::DISSIPATIVE_LINEAR:
55 case CONTROLLER_TYPE::DISSIPATIVE_ANGULAR:
56 case CONTROLLER_TYPE::DISSIPATIVE_DECOUPLED:
57 throw exceptions::InvalidControllerException(
58 "The JointState dissipative controller cannot be decoupled into linear and angular terms");
59 case CONTROLLER_TYPE::COMPLIANT_TWIST:
60 throw exceptions::InvalidControllerException(
61 "The compliant twist controller only works in Cartesian space");
63 case CONTROLLER_TYPE::NONE:
70 CONTROLLER_TYPE type,
const std::list<std::shared_ptr<ParameterInterface>>& parameters,
74 if (ctrl ==
nullptr) {
75 throw exceptions::InvalidControllerException(
"Cannot assign robot model to this controller!");
83 CONTROLLER_TYPE type,
const std::list<std::shared_ptr<ParameterInterface>>& parameters,
87 if (ctrl ==
nullptr) {
88 throw exceptions::InvalidControllerException(
"Cannot assign robot model to this controller!");
static std::shared_ptr< IController< S > > create_controller(CONTROLLER_TYPE type, unsigned int dimensions=6)
Create a controller of the desired type.
The Model class is a wrapper around pinocchio dynamic computation library with state_representation e...
Systems to determine a command output from measured and desired inputs.
CONTROLLER_TYPE
Enumeration of the implemented controllers.
Robot kinematics and dynamics.
Core state variables and objects.