aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
expose-autodiff.cpp
Go to the documentation of this file.
2
5
6namespace aligator {
7namespace python {
8
11 using namespace autodiff;
16 using context::Scalar;
19
20 {
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",
29 bp::no_init);
30 }
31
32 {
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);
39 }
40
41 {
42 using CostFiniteDiffType = CostFiniteDifferenceHelper<Scalar>;
43 bp::scope _ =
44 bp::class_<CostFiniteDiffType, bp::bases<CostAbstract>>(
45 "CostFiniteDifference",
46 "Define a cost function's derivatives using finite differences.",
47 bp::no_init)
48 .def(bp::init<xyz::polymorphic<CostAbstract>, Scalar>(
49 bp::args("self", "cost", "fd_eps")));
50 bp::class_<CostFiniteDiffType::Data, bp::bases<CostData>>("Data",
51 bp::no_init)
52 .def_readonly("c1", &CostFiniteDiffType::Data::c1)
53 .def_readonly("c2", &CostFiniteDiffType::Data::c2);
54 }
55}
56
57} // namespace python
58} // namespace aligator
ManifoldAbstractTpl< Scalar > Manifold
Definition context.hpp:14
void exposeAutodiff()
Expose autodiff helpers.
Main package namespace.
Stage costs for control problems.
Definition fwd.hpp:62
Data struct for CostAbstractTpl.
Definition fwd.hpp:65
Dynamics model: describes system dynamics through an implicit relation .
Definition fwd.hpp:68
Base struct for function data.
Definition fwd.hpp:59
Class representing ternary functions .
Definition fwd.hpp:53