| 100 | } // namespace aligator |
| 101 | |
| 102 | BOOST_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(); |
nothing calls this directly
no test coverage detected