aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
expose-integrators.cpp
Go to the documentation of this file.
1
3
7
11
12namespace aligator {
13namespace python {
14using context::Scalar;
15using namespace aligator::dynamics;
19
22
23 using PolyIntegrator = xyz::polymorphic<IntegratorAbstract>;
24 using PyIntegratorAbstract = PyDynamics<IntegratorAbstract>;
25 register_polymorphic_to_python<PolyIntegrator>();
26
28 conversions_visitor;
29
30 bp::class_<PyIntegratorAbstract, bp::bases<DynamicsModel>,
31 boost::noncopyable>("IntegratorAbstract",
32 "Base class for numerical integrators.",
33 bp::init<const xyz::polymorphic<DAEType> &>(
34 "Construct the integrator from a DAE.",
35 bp::args("self", "cont_dynamics")))
36 .def_readwrite("continuous_dynamics",
37 &IntegratorAbstract::continuous_dynamics_,
38 "The underlying ODE or DAE.")
39 .add_property("space",
40 bp::make_function(&IntegratorAbstract::space,
41 bp::return_internal_reference<>()),
42 "Return the state manifold.")
43 // allow casting custom Python class to polymorphic<base_classes>...
44 .def(conversions_visitor);
45
46 bp::register_ptr_to_python<shared_ptr<IntegratorDataTpl<Scalar>>>();
47 bp::class_<IntegratorDataTpl<Scalar>, bp::bases<DynamicsData>>(
48 "IntegratorData", "Base class for integrators' data.", bp::no_init)
49 .def_readwrite("continuous_data",
51
52 using MidpointIntegrator = IntegratorMidpointTpl<Scalar>;
53 bp::class_<MidpointIntegrator, bp::bases<IntegratorAbstract>>(
54 "IntegratorMidpoint", bp::init<xyz::polymorphic<DAEType>, Scalar>(
55 bp::args("self", "dae", "timestep")))
56 .def_readwrite("timestep", &MidpointIntegrator::timestep_, "Time step.")
57 .def(conversions_visitor);
58
59 bp::register_ptr_to_python<shared_ptr<IntegratorMidpointDataTpl<Scalar>>>();
60 bp::class_<IntegratorMidpointDataTpl<Scalar>,
61 bp::bases<IntegratorDataTpl<Scalar>>>("IntegratorMidpointData",
62 bp::no_init);
63}
64
65} // namespace python
66} // namespace aligator
Base definitions for numerical integrators.
Namespace for modelling system dynamics.
void exposeIntegrators()
Expose numerical integrators.
Main package namespace.
Dynamics model: describes system dynamics through an implicit relation .
Definition fwd.hpp:68
Continuous dynamics described by differential-algebraic equations (DAEs) .
Definition fwd.hpp:12
Base class for (implicit) numerical integrators.
Data class for numerical integrators (IntegratorAbstractTpl).