1#include "controllers_bindings.h"
3#include <controllers/ControllerFactory.hpp>
4#include <controllers/IController.hpp>
5#include <robot_model/Model.hpp>
6#include <state_representation/space/Jacobian.hpp>
7#include <state_representation/space/cartesian/CartesianState.hpp>
8#include <state_representation/space/joint/JointPositions.hpp>
9#include <state_representation/space/joint/JointState.hpp>
11#include "py_controller.h"
14using namespace py_parameter;
16void cartesian_controller(py::module_& m) {
17 py::object parameter_map = py::module_::import(
"state_representation").attr(
"ParameterMap");
18 py::class_<IController<CartesianState>, std::shared_ptr<IController<CartesianState>>,
PyController<CartesianState>> c(m,
"ICartesianController", parameter_map);
22 "Compute the command output based on the commanded state and a feedback state.",
"command_state"_a,
"feedback_state"_a);
25 "Compute the command output in joint space from command and feedback states in task space.",
"command_state"_a,
"feedback_state"_a,
"jacobian"_a);
28 "Compute the command output in joint space from command and feedback states in task space.",
"command_state"_a,
"feedback_state"_a,
"joint_positions"_a,
"frame"_a = std::string(
""));
34void bind_cartesian_controllers(py::module_& m) {
35 cartesian_controller(m);
37 m.def(
"create_cartesian_controller", [](
CONTROLLER_TYPE type,
const std::list<ParameterContainer>& parameters) -> py::object {
39 },
"Create a controller of the desired type with initial parameters.",
"type"_a,
"parameters"_a);
41 m.def(
"create_cartesian_controller", [](
CONTROLLER_TYPE type) -> py::object {
43 },
"Create a controller of the desired type.",
"type"_a);
47 },
"Create a controller of the desired type with initial parameters and an associated robot model.",
"type"_a,
"parameters"_a,
"robot_model"_a);
51 },
"Create a controller of the desired type with an associated robot model.",
"type"_a,
"robot_model"_a);
static std::shared_ptr< IController< S > > create_controller(CONTROLLER_TYPE type, unsigned int dimensions=6)
Create a controller of the desired type.
Abstract class to define a controller in a desired state type, such as joint or Cartesian spaces.
The Model class is a wrapper around pinocchio dynamic computation library with state_representation e...
CONTROLLER_TYPE
Enumeration of the implemented controllers.
Robot kinematics and dynamics.
Core state variables and objects.