3#ifdef ALIGATOR_WITH_CROCODDYL_COMPAT
6#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
16void exposeCrocoddylCompat() {
17 bp::import(
"crocoddyl");
20 namespace ns_croc = ::aligator::compat::croc;
21 bp::def(
"convertCrocoddylProblem",
22 &ns_croc::convertCrocoddylProblem<context::Scalar>,
23 bp::args(
"croc_problem"),
24 "Convert a Crocoddyl problem to an aligator problem.");
27 using StateAbstract = crocoddyl::StateAbstractTpl<Scalar>;
28 using ns_croc::context::ActionDataWrapper;
29 using ns_croc::context::ActionModelWrapper;
30 using ns_croc::context::DynamicsDataWrapper;
31 using ns_croc::context::StateWrapper;
33 bp::class_<ActionModelWrapper, bp::bases<context::StageModel>>(
34 "ActionModelWrapper",
"Wrapper for Crocoddyl action models.",
35 bp::init<boost::shared_ptr<CrocActionModel>>(bp::args(
"action_model")))
36 .def_readonly(
"action_model", &ActionModelWrapper::action_model_,
37 "Underlying Crocoddyl ActionModel.")
38 .def(PolymorphicMultiBaseVisitor<context::StageModel>());
40 bp::register_ptr_to_python<shared_ptr<ActionDataWrapper>>();
41 bp::class_<ActionDataWrapper, bp::bases<context::StageData>>(
42 "ActionDataWrapper", bp::no_init)
43 .def(bp::init<const ActionModelWrapper &>(
44 bp::args(
"self",
"croc_action_model")))
45 .def_readonly(
"croc_action_data", &ActionDataWrapper::croc_action_data,
46 "Underlying Crocoddyl action data.");
48 bp::class_<DynamicsDataWrapper, bp::bases<context::StageFunctionData>>(
49 "DynamicsDataWrapper", bp::no_init)
50 .def(bp::init<const CrocActionModel &>(bp::args(
"self",
"action_model")));
52 bp::class_<StateWrapper, bp::bases<context::Manifold>>(
53 "StateWrapper",
"Wrapper for a Crocoddyl state.", bp::no_init)
55 bp::init<boost::shared_ptr<StateAbstract>>(bp::args(
"self",
"state")))
56 .def_readonly(
"croc_state", &StateWrapper::croc_state)
57 .def(PolymorphicMultiBaseVisitor<context::Manifold>());
crocoddyl::ActionModelAbstractTpl< Scalar > CrocActionModel