aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
explicit-dynamics.hpp
Go to the documentation of this file.
1
3#pragma once
4
7
8namespace aligator {
9namespace python {
10namespace internal {
11
16template <class ExplicitBase = context::ExplicitDynamics>
17struct PyExplicitDynamics : ExplicitBase, bp::wrapper<ExplicitBase> {
18 using Scalar = context::Scalar;
20 // All functions in the interface take this type for output
21 using Data = ExplicitDynamicsDataTpl<Scalar>;
22 using StageFunctionData = StageFunctionDataTpl<Scalar>;
23
24 template <typename... Args>
25 PyExplicitDynamics(Args &&...args) : ExplicitBase(args...) {}
26
27 virtual void forward(const ConstVectorRef &x, const ConstVectorRef &u,
28 Data &data) const {
29 ALIGATOR_PYTHON_OVERRIDE_PURE(void, "forward", x, u, boost::ref(data));
30 }
31
32 virtual void dForward(const ConstVectorRef &x, const ConstVectorRef &u,
33 Data &data) const {
34 ALIGATOR_PYTHON_OVERRIDE_PURE(void, "dForward", x, u, boost::ref(data));
35 }
36
37 shared_ptr<StageFunctionData> createData() const {
38 ALIGATOR_PYTHON_OVERRIDE(shared_ptr<StageFunctionData>, ExplicitBase,
39 createData, );
40 }
41
42 shared_ptr<StageFunctionData> default_createData() const {
43 return ExplicitBase::createData();
44 }
45};
46
47} // namespace internal
48} // namespace python
49} // namespace aligator
#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 macros.hpp:50
#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 macros.hpp:41
#define ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
Definition math.hpp:18
Main package namespace.
ExplicitDynamicsDataTpl< Scalar > Data
virtual shared_ptr< BaseData > createData() const
Instantiate a Data object.
virtual void forward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const =0
Evaluate the forward discrete dynamics.
virtual void dForward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const =0
Compute the Jacobians of the forward dynamics.