aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
fly-high.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "./fwd.hpp"
5#include <proxsuite-nlp/modelling/spaces/multibody.hpp>
6
7namespace aligator {
8
10template <typename _Scalar>
12 using Scalar = _Scalar;
14 static constexpr int NR = 2;
15
18 using Model = pinocchio::ModelTpl<Scalar>;
19
20 struct Data;
21
22 FlyHighResidualTpl(const int ndx, const Model &model,
23 const pinocchio::FrameIndex frame_id, Scalar slope,
24 int nu);
25
26 void evaluate(const ConstVectorRef &x, BaseData &data) const;
27 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
28
29 shared_ptr<BaseData> createData() const {
30 return std::make_shared<Data>(*this);
31 }
32
33 const auto &getModel() const { return pin_model_; }
34
36
37private:
38 Model pin_model_;
39};
40
41template <typename Scalar>
43
44template <typename Scalar>
46 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
47 using BaseData::ndx1;
48 using BaseData::nr;
49 using BaseData::nu;
50
52 : BaseData(model.ndx1, model.nu, model.nr), pdata_(model.pin_model_),
53 d_dq(6, model.pin_model_.nv), d_dv(6, model.pin_model_.nv),
54 l_dnu_dq(6, model.pin_model_.nv), l_dnu_dv(6, model.pin_model_.nv),
55 o_dv_dq(3, model.pin_model_.nv), o_dv_dv(3, model.pin_model_.nv),
56 vxJ(3, model.pin_model_.nv) {
57 d_dq.setZero();
58 d_dv.setZero();
59 l_dnu_dq.setZero();
60 l_dnu_dv.setZero();
61 o_dv_dq.setZero();
62 o_dv_dv.setZero();
63 vxJ.setZero();
64 }
65
66 pinocchio::DataTpl<Scalar> pdata_;
67 Matrix6Xs d_dq, d_dv;
68 Matrix6Xs l_dnu_dq, l_dnu_dv;
69 Matrix3Xs o_dv_dq, o_dv_dv, vxJ;
71};
72
73} // namespace aligator
74
75#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
76#include "aligator/modelling/multibody/fly-high.txx"
77#endif
Main package namespace.
typename FlyHighResidualTpl< Scalar >::Data FlyHighResidualDataTpl
Definition fly-high.hpp:42
Data(FlyHighResidualTpl const &model)
Definition fly-high.hpp:51
pinocchio::DataTpl< Scalar > pdata_
Definition fly-high.hpp:66
A port of sobec's ResidualModelFlyHighTpl.
Definition fly-high.hpp:11
FlyHighResidualTpl(const int ndx, const Model &model, const pinocchio::FrameIndex frame_id, Scalar slope, int nu)
static constexpr int NR
Definition fly-high.hpp:14
void evaluate(const ConstVectorRef &x, BaseData &data) const
pinocchio::ModelTpl< Scalar > Model
Definition fly-high.hpp:18
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
const auto & getModel() const
Definition fly-high.hpp:33
shared_ptr< BaseData > createData() const
Instantiate a Data object.
Definition fly-high.hpp:29
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