aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
center-of-mass-velocity.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "./fwd.hpp"
5
6#include <pinocchio/multibody/model.hpp>
7
8namespace aligator {
9
10template <typename Scalar> struct CenterOfMassVelocityDataTpl;
11
12template <typename _Scalar>
14public:
15 using Scalar = _Scalar;
18 using BaseData = typename Base::Data;
19 using Model = pinocchio::ModelTpl<Scalar>;
20 using SE3 = pinocchio::SE3Tpl<Scalar>;
22
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
47template <typename Scalar>
49 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
51 using PinData = pinocchio::DataTpl<Scalar>;
52
57
60};
61
62#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
65#endif
66} // namespace aligator
Main package namespace.
math_types< Scalar >::Matrix3Xs fJf_
Jacobian of the error.
CenterOfMassVelocityDataTpl(const CenterOfMassVelocityResidualTpl< Scalar > &model)
shared_ptr< BaseData > createData() const
Instantiate a Data object.
void evaluate(const ConstVectorRef &x, BaseData &data) const
CenterOfMassVelocityResidualTpl(const int ndx, const int nu, const Model &model, const Vector3s &frame_vel)
CenterOfMassVelocityDataTpl< Scalar > Data
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
ALIGATOR_DEPRECATED void setReference(const Eigen::Ref< const Vector3s > &v_new)
ALIGATOR_DEPRECATED const Vector3s & getReference() const
StageFunctionDataTpl(const int ndx, const int nu, const int nr)
const int nu
Control dimension.
StageFunctionDataTpl< Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.
StageFunctionTpl< Scalar > Base
Typedefs for math (Eigen vectors, matrices) depending on scalar type.
Definition math.hpp:122