Control Libraries 7.4.0
Loading...
Searching...
No Matches
bind_joint_ds.cpp
1#include "dynamical_systems_bindings.hpp"
2
3#include <dynamical_systems/DynamicalSystemFactory.hpp>
4#include <dynamical_systems/IDynamicalSystem.hpp>
5#include <state_representation/space/joint/JointState.hpp>
6
7#include "py_dynamical_system.hpp"
8
9using namespace state_representation;
10using namespace py_parameter;
11
12void joint(py::module_& m) {
13 py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap");
14 py::class_<IDynamicalSystem<JointState>, std::shared_ptr<IDynamicalSystem<JointState>>, PyDynamicalSystem<JointState>> c(m, "IJointDS", parameter_map);
15
16 c.def("is_compatible", &IDynamicalSystem<JointState>::is_compatible);
18 c.def("get_base_frame", &IDynamicalSystem<JointState>::get_base_frame);
19 c.def("set_base_frame", &IDynamicalSystem<JointState>::set_base_frame);
20}
21
22void bind_joint_ds(py::module_& m) {
23 joint(m);
24
25 m.def("create_joint_ds", [](DYNAMICAL_SYSTEM_TYPE type, const std::list<ParameterContainer>& parameters) -> py::object {
26 return py::cast(JointDynamicalSystemFactory::create_dynamical_system(type, container_to_interface_ptr_list(parameters)));
27 }, "Create a dynamical system of the desired type with initial parameters.", "type"_a, "parameters"_a);
28
29
30 m.def("create_joint_ds", [](DYNAMICAL_SYSTEM_TYPE type) -> py::object {
31 return py::cast(JointDynamicalSystemFactory::create_dynamical_system(type, std::list<std::shared_ptr<ParameterInterface>>()));
32 }, "Create a dynamical system of the desired type.", "type"_a);
33}
static std::shared_ptr< IDynamicalSystem< S > > create_dynamical_system(DYNAMICAL_SYSTEM_TYPE type)
Create a dynamical system of the desired type.
Abstract class for a dynamical system.
DYNAMICAL_SYSTEM_TYPE
Enumeration of the implemented dynamical systems.
Core state variables and objects.