aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
linear-momentum.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace aligator {
6
7template <typename Scalar> struct LinearMomentumDataTpl;
8
18template <typename _Scalar>
20public:
21 using Scalar = _Scalar;
24 using BaseData = typename Base::Data;
25 using Data = LinearMomentumDataTpl<Scalar>;
26
27 LinearMomentumResidualTpl(const int ndx, const int nu, const Vector3s &h_ref)
28 : Base(ndx, nu, 3), h_ref_(h_ref) {}
29
30 const Vector3s &getReference() const { return h_ref_; }
31 void setReference(const Eigen::Ref<const Vector3s> &h_new) { h_ref_ = h_new; }
32
33 void evaluate(const ConstVectorRef &x, BaseData &data) const;
34
35 void computeJacobians(const ConstVectorRef &, BaseData &data) const;
36
37 shared_ptr<BaseData> createData() const {
38 return allocate_shared_eigen_aligned<Data>(this);
39 }
40
41protected:
42 Vector3s h_ref_;
43};
44
45template <typename Scalar>
47 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
48 using Base = StageFunctionDataTpl<Scalar>;
49
50 LinearMomentumDataTpl(const LinearMomentumResidualTpl<Scalar> *model);
51};
52
53} // namespace aligator
54
55#include "aligator/modelling/centroidal/linear-momentum.hxx"
56
57#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
58#include "./linear-momentum.txx"
59#endif
Main package namespace.
LinearMomentumDataTpl(const LinearMomentumResidualTpl< Scalar > *model)
This residual returns the linear momentum for a centroidal model with state .
void computeJacobians(const ConstVectorRef &, BaseData &data) const
LinearMomentumDataTpl< Scalar > Data
void evaluate(const ConstVectorRef &x, BaseData &data) const
shared_ptr< BaseData > createData() const
Instantiate a Data object.
LinearMomentumResidualTpl(const int ndx, const int nu, const Vector3s &h_ref)
const Vector3s & getReference() const
void setReference(const Eigen::Ref< const Vector3s > &h_new)
Base struct for function data.
const int nu
Control dimension.
StageFunctionDataTpl< Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.