aligator  0.9.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
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), pin_model_(model), p_ref_(frame_trans) {}
39
40 const Vector3s &getReference() const { return p_ref_; }
41 void setReference(const Eigen::Ref<const Vector3s> &p_new) { p_ref_ = p_new; }
42
43 void evaluate(const ConstVectorRef &x, BaseData &data) const;
44
45 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
46
47 shared_ptr<BaseData> createData() const {
48 return std::make_shared<Data>(this);
49 }
50
51protected:
52 Vector3s p_ref_;
53};
54
55template <typename Scalar>
57 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
59 using PinData = pinocchio::DataTpl<Scalar>;
60
63
66};
67
68} // namespace aligator
69
70#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
71#include "./center-of-mass-translation.txx"
72#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)
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
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