MCPcopy Create free account
hub / github.com/Simple-Robotics/aligator / BOOST_PYTHON_MODULE

Function BOOST_PYTHON_MODULE

bindings/python/src/module.cpp:102–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100} // namespace aligator
101
102BOOST_PYTHON_MODULE(MODULE_NAME) {
103 using namespace aligator::python;
104 using aligator::context::ConstVectorRef;
105
106 bp::docstring_options module_docstring_options(true, true, true);
107
108 bp::scope().attr("__version__") = ALIGATOR_VERSION;
109#ifdef ALIGATOR_MULTITHREADING
110 bp::def("get_available_threads", &aligator::omp::get_available_threads,
111 "Get the number of available threads.");
112 bp::def("get_current_threads", &aligator::omp::get_current_threads,
113 "Get the current number of threads.");
114 bp::def("set_omp_default_options", &aligator::omp::set_default_options,
115 ("num_threads"_a, "dynamic"_a = true));
116#endif
117 eigenpy::enableEigenPy();
118
119 eigenpy::OptionalConverter<ConstVectorRef, std::optional>::registration();
120 eigenpy::detail::NoneToPython<std::nullopt_t>::registration();
121
122 register_string_view_converter();
123 eigenpy::StdVectorPythonVisitor<std::vector<std::string_view>, true>::expose(
124 "StdVec_StringView");
125
126 bp::import("warnings");
127#ifdef ALIGATOR_WITH_PINOCCHIO
128 bp::import("pinocchio");
129#endif
130
131 bp::def(
132 "has_pinocchio_features",
133 +[]() constexpr -> bool {
134 return
135#ifdef ALIGATOR_WITH_PINOCCHIO
136 true;
137#else
138 false;
139#endif
140 },
141 "Whether Aligator (and its Python bindings) were compiled with support "
142 "for Pinocchio.");
143
144 {
145 bp::scope manifolds = get_namespace("manifolds");
146 exposeManifolds();
147 }
148 exposeContainers();
149 exposeGAR();
150 exposeEnums();
151 exposeFunctions();
152 exposeCosts();
153 exposeConstraint();
154 exposeStage();
155 exposeProblem();
156 exposeFilter();
157 {
158 bp::scope dynamics = get_namespace("dynamics");
159 exposeContinuousDynamics();

Callers

nothing calls this directly

Calls 15

get_namespaceFunction · 0.85
exposeManifoldsFunction · 0.85
exposeContainersFunction · 0.85
exposeGARFunction · 0.85
exposeEnumsFunction · 0.85
exposeFunctionsFunction · 0.85
exposeCostsFunction · 0.85
exposeConstraintFunction · 0.85
exposeStageFunction · 0.85
exposeProblemFunction · 0.85
exposeFilterFunction · 0.85

Tested by

no test coverage detected