aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
explicit-dynamics.hpp
Go to the documentation of this file.
1
3#pragma once
4
7
10
11namespace aligator {
12namespace python {
14
19template <class Base = context::ExplicitDynamics>
21 : Base,
22 PolymorphicWrapper<PyExplicitDynamics<Base>, Base> {
25 // All functions in the interface take this type for output
27
28 using Base::Base;
29
30 void forward(const ConstVectorRef &x, const ConstVectorRef &u,
31 Data &data) const {
32 ALIGATOR_PYTHON_OVERRIDE_PURE(void, "forward", x, u, boost::ref(data));
33 }
34
35 void dForward(const ConstVectorRef &x, const ConstVectorRef &u,
36 Data &data) const {
37 ALIGATOR_PYTHON_OVERRIDE_PURE(void, "dForward", x, u, boost::ref(data));
38 }
39
40 shared_ptr<Data> createData() const {
41 ALIGATOR_PYTHON_OVERRIDE(shared_ptr<Data>, Base, createData, );
42 }
43
44 shared_ptr<Data> default_createData() const { return Base::createData(); }
45};
46
47} // namespace python
48} // namespace aligator
49
50namespace boost::python::objects {
51
52template <>
53struct value_holder<aligator::python::PyExplicitDynamics<>>
54 : aligator::python::OwningNonOwningHolder<
55 aligator::python::PyExplicitDynamics<>> {
56 using OwningNonOwningHolder::OwningNonOwningHolder;
57};
58
59template <>
60struct value_holder<aligator::python::PyExplicitDynamics<
61 aligator::context::ExplicitIntegratorAbstract>>
62 : aligator::python::OwningNonOwningHolder<
63 aligator::python::PyExplicitDynamics<
64 aligator::context::ExplicitIntegratorAbstract>> {
65 using OwningNonOwningHolder::OwningNonOwningHolder;
66};
67
68} // namespace boost::python::objects
#define ALIGATOR_PYTHON_OVERRIDE(ret_type, cname, fname,...)
Define the body of a virtual function override. This is meant to reduce boilerplate code when exposin...
Definition fwd.hpp:98
#define ALIGATOR_PYTHON_OVERRIDE_PURE(ret_type, pyname,...)
Define the body of a virtual function override. This is meant to reduce boilerplate code when exposin...
Definition fwd.hpp:90
Base definitions for explicit integrators.
DynamicsDataTpl< Scalar > DynamicsData
Definition context.hpp:29
The Python bindings.
Definition blk-matrix.hpp:5
Main package namespace.
Specific data struct for explicit dynamics ExplicitDynamicsModelTpl.
virtual shared_ptr< Data > createData() const
void dForward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const
Compute the Jacobians of the forward dynamics.
void forward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const
Evaluate the forward discrete dynamics.
shared_ptr< Data > default_createData() const
ExplicitDynamicsDataTpl< Scalar > Data
shared_ptr< Data > createData() const