aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
centroidal-momentum-derivative.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 CentroidalMomentumDerivativeDataTpl;
11
16template <typename _Scalar>
18public:
19 using Scalar = _Scalar;
22 using BaseData = typename Base::Data;
23 using Model = pinocchio::ModelTpl<Scalar>;
24 using SE3 = pinocchio::SE3Tpl<Scalar>;
26
28 double mass_;
29 Vector3s gravity_;
30 std::vector<bool> contact_states_;
31 std::vector<pinocchio::FrameIndex> contact_ids_;
33
35 const int ndx, const Model &model, const Vector3s &gravity,
36 const std::vector<bool> &contact_states,
37 const std::vector<pinocchio::FrameIndex> &contact_ids,
38 const int force_size);
39
40 void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
41 BaseData &data) const;
42
43 void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u,
44 BaseData &data) const;
45
46 shared_ptr<BaseData> createData() const {
47 return std::make_shared<Data>(this);
48 }
49};
50
51template <typename Scalar>
53 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
55 using PinData = pinocchio::DataTpl<Scalar>;
56 using Matrix3Xs = typename math_types<Scalar>::Matrix3Xs;
57 using Matrix6Xs = typename math_types<Scalar>::Matrix6Xs;
58 using Matrix3s = Eigen::Matrix<Scalar, 3, 3>;
59
65
68};
69
70} // namespace aligator
71
72#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
73#include "aligator/modelling/multibody/centroidal-momentum-derivative.txx"
74#endif
Base definitions for ternary functions.
Main package namespace.
CentroidalMomentumDerivativeDataTpl(const CentroidalMomentumDerivativeResidualTpl< Scalar > *model)
This residual returns the derivative of centroidal momentum for a kinodynamics model.
void computeJacobians(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const
CentroidalMomentumDerivativeResidualTpl(const int ndx, const Model &model, const Vector3s &gravity, const std::vector< bool > &contact_states, const std::vector< pinocchio::FrameIndex > &contact_ids, const int force_size)
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const
shared_ptr< BaseData > createData() const
Instantiate a Data object.
Base struct for function data.
Definition fwd.hpp:62
Class representing ternary functions .
Definition fwd.hpp:56
StageFunctionDataTpl< Scalar > Data