3#ifdef ALIGATOR_WITH_PINOCCHIO
6#include <proxsuite-nlp/modelling/spaces/multibody.hpp>
11template <
typename _Scalar>
12struct FlyHighResidualTpl : UnaryFunctionTpl<_Scalar>, frame_api {
13 using Scalar = _Scalar;
15 static constexpr int NR = 2;
17 using Base = UnaryFunctionTpl<Scalar>;
18 using BaseData = StageFunctionDataTpl<Scalar>;
19 using Model = pinocchio::ModelTpl<Scalar>;
23 FlyHighResidualTpl(
const int ndx,
const Model &model,
24 const pinocchio::FrameIndex frame_id, Scalar slope,
27 void evaluate(
const ConstVectorRef &x, BaseData &data)
const;
28 void computeJacobians(
const ConstVectorRef &x, BaseData &data)
const;
30 shared_ptr<BaseData> createData()
const {
31 return std::make_shared<Data>(*
this);
34 const auto &getModel()
const {
return pin_model_; }
42template <
typename Scalar>
43using FlyHighResidualDataTpl =
typename FlyHighResidualTpl<Scalar>::Data;
45template <
typename Scalar>
46struct FlyHighResidualTpl<Scalar>::Data : StageFunctionDataTpl<Scalar> {
47 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
52 Data(FlyHighResidualTpl
const &model)
53 : BaseData(model.ndx1, model.nu, model.nr), pdata_(model.pin_model_),
54 d_dq(6, model.pin_model_.nv), d_dv(6, model.pin_model_.nv),
55 l_dnu_dq(6, model.pin_model_.nv), l_dnu_dv(6, model.pin_model_.nv),
56 o_dv_dq(3, model.pin_model_.nv), o_dv_dv(3, model.pin_model_.nv),
57 vxJ(3, model.pin_model_.nv) {
67 pinocchio::DataTpl<Scalar> pdata_;
69 Matrix6Xs l_dnu_dq, l_dnu_dv;
70 Matrix3Xs o_dv_dq, o_dv_dv, vxJ;
76#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
77#include "aligator/modelling/multibody/fly-high.txx"
#define ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)