aligator  0.9.0
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;
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 std::make_shared<Data>(this);
39 }
40
41protected:
42 Vector3s h_ref_;
43};
44
45template <typename Scalar>
47 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
49
51};
52
53} // namespace aligator
54
55#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
56#include "aligator/modelling/centroidal/linear-momentum.txx"
57#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
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.
Definition fwd.hpp:62
StageFunctionDataTpl< _Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.
Definition fwd.hpp:59