aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
centroidal-momentum.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "./fwd.hpp"
5
6#include <pinocchio/multibody/model.hpp>
7
8namespace aligator {
9
10template <typename Scalar> struct CentroidalMomentumDataTpl;
11
17template <typename _Scalar>
19public:
20 using Scalar = _Scalar;
23 using BaseData = typename Base::Data;
24 using Model = pinocchio::ModelTpl<Scalar>;
25 using SE3 = pinocchio::SE3Tpl<Scalar>;
27
29 Vector6s h_ref_;
30
31 CentroidalMomentumResidualTpl(const int ndx, const int nu, const Model &model,
32 const Vector6s &h_ref)
33 : Base(ndx, nu, 6), pin_model_(model), h_ref_(h_ref) {}
34
35 void evaluate(const ConstVectorRef &x, BaseData &data) const;
36
37 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
38
39 const Vector6s &getReference() const { return h_ref_; }
40 void setReference(const Eigen::Ref<const Vector6s> &h_new) { h_ref_ = h_new; }
41
42 shared_ptr<BaseData> createData() const {
43 return std::make_shared<Data>(this);
44 }
45};
46
47template <typename Scalar>
49 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
51 using PinData = pinocchio::DataTpl<Scalar>;
52 using Matrix6Xs = typename math_types<Scalar>::Matrix6Xs;
53
60
62};
63
64} // namespace aligator
65
66#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
67#include "aligator/modelling/multibody/centroidal-momentum.txx"
68#endif
Main package namespace.
CentroidalMomentumDataTpl(const CentroidalMomentumResidualTpl< Scalar > *model)
PinData pin_data_
Pinocchio data object.
typename math_types< Scalar >::Matrix6Xs Matrix6Xs
pinocchio::DataTpl< Scalar > PinData
This residual returns the derivative of centroidal momentum for a kinodynamics model.
void setReference(const Eigen::Ref< const Vector6s > &h_new)
CentroidalMomentumResidualTpl(const int ndx, const int nu, const Model &model, const Vector6s &h_ref)
void evaluate(const ConstVectorRef &x, BaseData &data) const
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
shared_ptr< BaseData > createData() const
Instantiate a Data object.
Base struct for function data.
Definition fwd.hpp:62
Represents unary functions of the form , with no control (or next-state) arguments.
Definition fwd.hpp:59
StageFunctionDataTpl< Scalar > Data