aligator  0.14.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
center-of-mass-translation.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "./fwd.hpp"
5
6#include <pinocchio/multibody/model.hpp>
7
8namespace aligator {
9
10template <typename Scalar> struct CenterOfMassTranslationDataTpl;
11
20
21template <typename _Scalar>
23 frame_api {
24public:
25 using Scalar = _Scalar;
28 using BaseData = typename Base::Data;
29 using Model = pinocchio::ModelTpl<Scalar>;
30 using SE3 = pinocchio::SE3Tpl<Scalar>;
32
34
35 CenterOfMassTranslationResidualTpl(const int ndx, const int nu,
36 const Model &model,
37 const Vector3s &frame_trans)
38 : Base(ndx, nu, 3)
39 , pin_model_(model)
40 , p_ref_(frame_trans) {}
41
42 const Vector3s &getReference() const { return p_ref_; }
43 void setReference(const Eigen::Ref<const Vector3s> &p_new) { p_ref_ = p_new; }
44
45 void evaluate(const ConstVectorRef &x, BaseData &data) const;
46
47 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
48
49 shared_ptr<BaseData> createData() const {
50 return std::make_shared<Data>(this);
51 }
52
53protected:
54 Vector3s p_ref_;
55};
56
57template <typename Scalar>
59 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
61 using PinData = pinocchio::DataTpl<Scalar>;
62
65
68};
69
70} // namespace aligator
71
72#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
73#include "./center-of-mass-translation.txx"
74#endif
Main package namespace.
CenterOfMassTranslationDataTpl(const CenterOfMassTranslationResidualTpl< Scalar > *model)
This residual returns the Center of Mass translation for a centroidal model with state .
shared_ptr< BaseData > createData() const
Instantiate a Data object.
void setReference(const Eigen::Ref< const Vector3s > &p_new)
CenterOfMassTranslationDataTpl< Scalar > Data
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
CenterOfMassTranslationResidualTpl(const int ndx, const int nu, const Model &model, const Vector3s &frame_trans)
void evaluate(const ConstVectorRef &x, BaseData &data) const
StageFunctionDataTpl(const int ndx, const int nu, const int nr)
const int nu
Control dimension.
StageFunctionDataTpl< Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.
StageFunctionTpl< Scalar > Base