aligator
0.19.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Toggle main menu visibility
Loading...
Searching...
No Matches
center-of-mass-velocity.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
aligator/core/unary-function.hpp
"
4
#include "
./fwd.hpp
"
5
6
#include <pinocchio/multibody/model.hpp>
7
8
namespace
aligator
{
9
10
template
<
typename
Scalar>
struct
CenterOfMassVelocityDataTpl
;
11
12
template
<
typename
_Scalar>
13
struct
CenterOfMassVelocityResidualTpl
:
UnaryFunctionTpl
<_Scalar>,
frame_api
{
14
public
:
15
using
Scalar
= _Scalar;
16
ALIGATOR_DYNAMIC_TYPEDEFS
(
Scalar
);
17
ALIGATOR_UNARY_FUNCTION_INTERFACE
(
Scalar
);
18
using
BaseData
=
typename
Base::Data
;
19
using
Model
= pinocchio::ModelTpl<Scalar>;
20
using
SE3
= pinocchio::SE3Tpl<Scalar>;
21
using
Data
=
CenterOfMassVelocityDataTpl<Scalar>
;
22
23
Model
pin_model_
;
24
Vector3s
v_ref_
;
25
26
CenterOfMassVelocityResidualTpl
(
const
int
ndx,
const
int
nu
,
27
const
Model
&model,
const
Vector3s &frame_vel)
28
:
Base
(ndx,
nu
, 3)
29
,
pin_model_
(model)
30
,
v_ref_
(frame_vel) {}
31
32
ALIGATOR_DEPRECATED
const
Vector3s &
getReference
()
const
{
return
v_ref_
; }
33
ALIGATOR_DEPRECATED
void
34
setReference
(
const
Eigen::Ref<const Vector3s> &v_new) {
35
v_ref_
= v_new;
36
}
37
38
void
evaluate
(
const
ConstVectorRef &x,
BaseData
&data)
const
;
39
40
void
computeJacobians
(
const
ConstVectorRef &x,
BaseData
&data)
const
;
41
42
shared_ptr<BaseData>
createData
()
const
{
43
return
std::make_shared<Data>(*
this
);
44
}
45
};
46
47
template
<
typename
Scalar>
48
struct
CenterOfMassVelocityDataTpl
:
StageFunctionDataTpl
<Scalar> {
49
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
50
using
Base
=
StageFunctionDataTpl<Scalar>
;
51
using
PinData
= pinocchio::DataTpl<Scalar>;
52
54
PinData
pin_data_
;
56
typename
math_types<Scalar>::Matrix3Xs
fJf_
;
57
58
CenterOfMassVelocityDataTpl
(
59
const
CenterOfMassVelocityResidualTpl<Scalar>
&model);
60
};
61
62
#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
63
extern
template
struct
CenterOfMassVelocityResidualTpl<context::Scalar>
;
64
extern
template
struct
CenterOfMassVelocityDataTpl<context::Scalar>
;
65
#endif
66
}
// namespace aligator
fwd.hpp
aligator
Main package namespace.
Definition
action-model-wrap.hpp:14
aligator::CenterOfMassVelocityDataTpl
Definition
center-of-mass-velocity.hpp:48
aligator::CenterOfMassVelocityDataTpl::Base
StageFunctionDataTpl< Scalar > Base
Definition
center-of-mass-velocity.hpp:50
aligator::CenterOfMassVelocityDataTpl::PinData
pinocchio::DataTpl< Scalar > PinData
Definition
center-of-mass-velocity.hpp:51
aligator::CenterOfMassVelocityDataTpl::pin_data_
PinData pin_data_
Pinocchio data object.
Definition
center-of-mass-velocity.hpp:54
aligator::CenterOfMassVelocityDataTpl::fJf_
math_types< Scalar >::Matrix3Xs fJf_
Jacobian of the error.
Definition
center-of-mass-velocity.hpp:56
aligator::CenterOfMassVelocityDataTpl::CenterOfMassVelocityDataTpl
CenterOfMassVelocityDataTpl(const CenterOfMassVelocityResidualTpl< Scalar > &model)
aligator::CenterOfMassVelocityResidualTpl
Definition
center-of-mass-velocity.hpp:13
aligator::CenterOfMassVelocityResidualTpl::createData
shared_ptr< BaseData > createData() const
Instantiate a Data object.
Definition
center-of-mass-velocity.hpp:42
aligator::CenterOfMassVelocityResidualTpl::ALIGATOR_DYNAMIC_TYPEDEFS
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
aligator::CenterOfMassVelocityResidualTpl::evaluate
void evaluate(const ConstVectorRef &x, BaseData &data) const
aligator::CenterOfMassVelocityResidualTpl::pin_model_
Model pin_model_
Definition
center-of-mass-velocity.hpp:23
aligator::CenterOfMassVelocityResidualTpl::BaseData
typename Base::Data BaseData
Definition
center-of-mass-velocity.hpp:18
aligator::CenterOfMassVelocityResidualTpl::Scalar
_Scalar Scalar
Definition
center-of-mass-velocity.hpp:15
aligator::CenterOfMassVelocityResidualTpl::CenterOfMassVelocityResidualTpl
CenterOfMassVelocityResidualTpl(const int ndx, const int nu, const Model &model, const Vector3s &frame_vel)
Definition
center-of-mass-velocity.hpp:26
aligator::CenterOfMassVelocityResidualTpl::v_ref_
Vector3s v_ref_
Definition
center-of-mass-velocity.hpp:24
aligator::CenterOfMassVelocityResidualTpl::SE3
pinocchio::SE3Tpl< Scalar > SE3
Definition
center-of-mass-velocity.hpp:20
aligator::CenterOfMassVelocityResidualTpl::ALIGATOR_UNARY_FUNCTION_INTERFACE
ALIGATOR_UNARY_FUNCTION_INTERFACE(Scalar)
aligator::CenterOfMassVelocityResidualTpl::Data
CenterOfMassVelocityDataTpl< Scalar > Data
Definition
center-of-mass-velocity.hpp:21
aligator::CenterOfMassVelocityResidualTpl::Model
pinocchio::ModelTpl< Scalar > Model
Definition
center-of-mass-velocity.hpp:19
aligator::CenterOfMassVelocityResidualTpl::computeJacobians
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
aligator::CenterOfMassVelocityResidualTpl::setReference
ALIGATOR_DEPRECATED void setReference(const Eigen::Ref< const Vector3s > &v_new)
Definition
center-of-mass-velocity.hpp:34
aligator::CenterOfMassVelocityResidualTpl::getReference
ALIGATOR_DEPRECATED const Vector3s & getReference() const
Definition
center-of-mass-velocity.hpp:32
aligator::StageFunctionDataTpl< Scalar >::StageFunctionDataTpl
StageFunctionDataTpl(const int ndx, const int nu, const int nr)
aligator::StageFunctionTpl::nu
const int nu
Control dimension.
Definition
function-abstract.hpp:21
aligator::StageFunctionTpl< Scalar >::Data
StageFunctionDataTpl< Scalar > Data
Definition
function-abstract.hpp:16
aligator::UnaryFunctionTpl
Represents unary functions of the form , with no control (or next-state) arguments.
Definition
unary-function.hpp:12
aligator::UnaryFunctionTpl::Base
StageFunctionTpl< Scalar > Base
Definition
unary-function.hpp:15
aligator::frame_api
Definition
fwd.hpp:9
aligator::math_types
Typedefs for math (Eigen vectors, matrices) depending on scalar type.
Definition
math.hpp:123
unary-function.hpp
include
aligator
modelling
multibody
center-of-mass-velocity.hpp
Generated by
1.17.0