11 using namespace autodiff;
21 using FiniteDiffType = FiniteDifferenceHelper<Scalar>;
22 bp::scope _ = bp::class_<FiniteDiffType, bp::bases<StageFunction>>(
23 "FiniteDifferenceHelper",
24 "Make a function into a differentiable function/dynamics using"
25 " finite differences.",
26 bp::init<xyz::polymorphic<Manifold>, xyz::polymorphic<StageFunction>,
27 const Scalar>(bp::args(
"self",
"space",
"func",
"eps")));
28 bp::class_<FiniteDiffType::Data, bp::bases<StageFunctionData>>(
"Data",
33 using DynFiniteDiffType = DynamicsFiniteDifferenceHelper<Scalar>;
34 bp::scope _ = bp::class_<DynFiniteDiffType, bp::bases<DynamicsModel>>(
35 "DynamicsFiniteDifferenceHelper",
36 bp::init<xyz::polymorphic<Manifold>, xyz::polymorphic<DynamicsModel>,
37 const Scalar>(bp::args(
"self",
"space",
"dyn",
"eps")));
38 bp::class_<DynFiniteDiffType::Data>(
"Data", bp::no_init);
42 using CostFiniteDiffType = CostFiniteDifferenceHelper<Scalar>;
44 bp::class_<CostFiniteDiffType, bp::bases<CostAbstract>>(
45 "CostFiniteDifference",
46 "Define a cost function's derivatives using finite differences.",
48 .def(bp::init<xyz::polymorphic<CostAbstract>, Scalar>(
49 bp::args(
"self",
"cost",
"fd_eps")));
50 bp::class_<CostFiniteDiffType::Data, bp::bases<CostData>>(
"Data",
52 .def_readonly(
"c1", &CostFiniteDiffType::Data::c1)
53 .def_readonly(
"c2", &CostFiniteDiffType::Data::c2);
ManifoldAbstractTpl< Scalar > Manifold