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
3
#include "
aligator/core/unary-function.hpp
"
4
#include "
./fwd.hpp
"
5
#include <proxsuite-nlp/modelling/spaces/multibody.hpp>
6
7
namespace
aligator
{
8
10
template
<
typename
_Scalar>
11
struct
FlyHighResidualTpl
:
UnaryFunctionTpl
<_Scalar>,
frame_api
{
12
using
Scalar
= _Scalar;
13
ALIGATOR_DYNAMIC_TYPEDEFS
(
Scalar
);
14
static
constexpr
int
NR
= 2;
15
16
using
Base
=
UnaryFunctionTpl<Scalar>
;
17
using
BaseData
=
StageFunctionDataTpl<Scalar>
;
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
35
Scalar
slope_
;
36
37
private
:
38
Model
pin_model_;
39
};
40
41
template
<
typename
Scalar>
42
using
FlyHighResidualDataTpl
=
typename
FlyHighResidualTpl<Scalar>::Data
;
43
44
template
<
typename
Scalar>
45
struct
FlyHighResidualTpl
<
Scalar
>::
Data
:
StageFunctionDataTpl
<Scalar> {
46
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
47
using
BaseData::ndx1
;
48
using
BaseData::nr
;
49
using
BaseData::nu
;
50
51
Data
(
FlyHighResidualTpl
const
&model)
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;
70
Scalar
ez
;
71
};
72
73
}
// namespace aligator
74
75
#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
76
#include "aligator/modelling/multibody/fly-high.txx"
77
#endif
fwd.hpp
aligator
Main package namespace.
Definition
action-model-wrap.hpp:14
aligator::FlyHighResidualDataTpl
typename FlyHighResidualTpl< Scalar >::Data FlyHighResidualDataTpl
Definition
fly-high.hpp:42
aligator::FlyHighResidualTpl::Data
Definition
fly-high.hpp:45
aligator::FlyHighResidualTpl::Data::d_dq
Matrix6Xs d_dq
Definition
fly-high.hpp:67
aligator::FlyHighResidualTpl::Data::l_dnu_dq
Matrix6Xs l_dnu_dq
Definition
fly-high.hpp:68
aligator::FlyHighResidualTpl::Data::Data
Data(FlyHighResidualTpl const &model)
Definition
fly-high.hpp:51
aligator::FlyHighResidualTpl::Data::pdata_
pinocchio::DataTpl< Scalar > pdata_
Definition
fly-high.hpp:66
aligator::FlyHighResidualTpl::Data::ez
Scalar ez
Definition
fly-high.hpp:70
aligator::FlyHighResidualTpl::Data::o_dv_dq
Matrix3Xs o_dv_dq
Definition
fly-high.hpp:69
aligator::FlyHighResidualTpl
A port of sobec's ResidualModelFlyHighTpl.
Definition
fly-high.hpp:11
aligator::FlyHighResidualTpl::FlyHighResidualTpl
FlyHighResidualTpl(const int ndx, const Model &model, const pinocchio::FrameIndex frame_id, Scalar slope, int nu)
aligator::FlyHighResidualTpl::NR
static constexpr int NR
Definition
fly-high.hpp:14
aligator::FlyHighResidualTpl::evaluate
void evaluate(const ConstVectorRef &x, BaseData &data) const
aligator::FlyHighResidualTpl::slope_
Scalar slope_
Definition
fly-high.hpp:35
aligator::FlyHighResidualTpl::Model
pinocchio::ModelTpl< Scalar > Model
Definition
fly-high.hpp:18
aligator::FlyHighResidualTpl::computeJacobians
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
aligator::FlyHighResidualTpl::Scalar
_Scalar Scalar
Definition
fly-high.hpp:12
aligator::FlyHighResidualTpl::getModel
const auto & getModel() const
Definition
fly-high.hpp:33
aligator::FlyHighResidualTpl::ALIGATOR_DYNAMIC_TYPEDEFS
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
aligator::FlyHighResidualTpl::createData
shared_ptr< BaseData > createData() const
Instantiate a Data object.
Definition
fly-high.hpp:29
aligator::StageFunctionDataTpl
Base struct for function data.
Definition
fwd.hpp:62
aligator::StageFunctionDataTpl::nu
const int nu
Definition
function-abstract.hpp:78
aligator::StageFunctionDataTpl::Scalar
_Scalar Scalar
Definition
function-abstract.hpp:74
aligator::StageFunctionDataTpl::ndx1
const int ndx1
Definition
function-abstract.hpp:77
aligator::StageFunctionDataTpl::nr
const int nr
Definition
function-abstract.hpp:79
aligator::StageFunctionTpl< _Scalar >::nu
const int nu
Definition
function-abstract.hpp:21
aligator::StageFunctionTpl< _Scalar >::nr
const int nr
Definition
function-abstract.hpp:23
aligator::StageFunctionTpl< _Scalar >::ndx1
const int ndx1
Definition
function-abstract.hpp:19
aligator::UnaryFunctionTpl
Represents unary functions of the form , with no control (or next-state) arguments.
Definition
fwd.hpp:59
aligator::frame_api
Definition
fwd.hpp:7
unary-function.hpp
include
aligator
modelling
multibody
fly-high.hpp
Generated by
1.11.0