aligator  0.6.1
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
5
6namespace aligator {
7
8template <typename Scalar> struct CentroidalWrapperDataTpl;
9
16template <typename _Scalar>
18public:
19 using Scalar = _Scalar;
22 using FunPtr = shared_ptr<StageFunctionTpl<Scalar>>;
23 using BaseData = typename Base::Data;
24 using Data = CentroidalWrapperDataTpl<Scalar>;
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 allocate_shared_eigen_aligned<Data>(this);
37 }
38
40};
41
42template <typename Scalar>
44 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 using Base = StageFunctionDataTpl<Scalar>;
46
47 shared_ptr<Base> wrapped_data_;
48
49 CentroidalWrapperDataTpl(const CentroidalWrapperResidualTpl<Scalar> *model);
50};
51
52} // namespace aligator
53
54#include "aligator/modelling/centroidal/centroidal-wrapper.hxx"
55
56#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
57#include "./centroidal-wrapper.txx"
58#endif
Base definitions for ternary functions.
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
shared_ptr< StageFunctionTpl< Scalar > > FunPtr
CentroidalWrapperDataTpl< Scalar > Data
Base struct for function data.
const int nu
Control dimension.
StageFunctionDataTpl< Scalar > Data
const int ndx1
Current state dimension.
const int nr
Function codimension.
Represents unary functions of the form , with no control (or next-state) arguments.