Control Libraries 7.4.0
Loading...
Searching...
No Matches
bind_cartesian_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/cartesian/CartesianState.hpp>
6
7#include "py_dynamical_system.hpp"
8
9using namespace state_representation;
10using namespace py_parameter;
11
12void cartesian(py::module_& m) {
13 py::object parameter_map = py::module_::import("state_representation").attr("ParameterMap");
14 py::class_<IDynamicalSystem<CartesianState>, std::shared_ptr<IDynamicalSystem<CartesianState>>, PyDynamicalSystem<CartesianState>> c(m, "ICartesianDS", parameter_map);
15
20}
21
22void bind_cartesian_ds(py::module_& m) {
23 cartesian(m);
24
25 m.def("create_cartesian_ds", [](DYNAMICAL_SYSTEM_TYPE type, const std::list<ParameterContainer>& parameters) -> py::object {
26 return py::cast(CartesianDynamicalSystemFactory::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 m.def("create_cartesian_ds", [](DYNAMICAL_SYSTEM_TYPE type) -> py::object {
30 return py::cast(CartesianDynamicalSystemFactory::create_dynamical_system(type, std::list<std::shared_ptr<ParameterInterface>>()));
31 }, "Create a dynamical system of the desired type.", "type"_a);
32}
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.