aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
centroidal-wrapper.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <proxsuite-nlp/third-party/polymorphic_cxx14.hpp>
5
6namespace aligator {
7
8template <typename Scalar> struct CentroidalWrapperDataTpl;
9
16template <typename _Scalar>
18public:
19 using Scalar = _Scalar;
22 using FunPtr = xyz::polymorphic<StageFunctionTpl<Scalar>>;
23 using BaseData = typename Base::Data;
25
27 : Base(centroidal_cost->ndx1 + centroidal_cost->nu, centroidal_cost->nu,
28 centroidal_cost->nr),
29 centroidal_cost_(centroidal_cost) {}
30
31 void evaluate(const ConstVectorRef &x, BaseData &data) const;
32
33 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
34
35 shared_ptr<BaseData> createData() const {
36 return std::make_shared<Data>(this);
37 }
38
40};
41
42template <typename Scalar>
44 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46
47 shared_ptr<Base> wrapped_data_;
48
50};
51
52} // namespace aligator
53
54#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
55#include "aligator/modelling/centroidal/centroidal-wrapper.txx"
56#endif
Main package namespace.
CentroidalWrapperDataTpl(const CentroidalWrapperResidualTpl< Scalar > *model)
This residual acts as a wrapper for centroidal model cost functions in which the external forces are ...
shared_ptr< BaseData > createData() const
Instantiate a Data object.
void evaluate(const ConstVectorRef &x, BaseData &data) const
CentroidalWrapperResidualTpl(FunPtr centroidal_cost)
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
xyz::polymorphic< StageFunctionTpl< Scalar > > FunPtr
Base struct for function data.
Definition fwd.hpp:62
StageFunctionDataTpl< _Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.
Definition fwd.hpp:59