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