aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear 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
25 CenterOfMassVelocityResidualTpl(const int ndx, const int nu,
26 const Model &model, const Vector3s &frame_vel)
27 : Base(ndx, nu, 3), pin_model_(model), v_ref_(frame_vel) {}
28
29 const Vector3s &getReference() const { return v_ref_; }
30 void setReference(const Eigen::Ref<const Vector3s> &v_new) { v_ref_ = v_new; }
31
32 void evaluate(const ConstVectorRef &x, BaseData &data) const;
33
34 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
35
36 shared_ptr<BaseData> createData() const {
37 return std::make_shared<Data>(*this);
38 }
39
40protected:
41 Vector3s v_ref_;
42};
43
44template <typename Scalar>
46 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
48 using PinData = pinocchio::DataTpl<Scalar>;
49
53 typename math_types<Scalar>::Matrix3Xs fJf_;
54
57};
58
59} // namespace aligator
60
61#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
62#include "./center-of-mass-velocity.txx"
63#endif
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
void setReference(const Eigen::Ref< const Vector3s > &v_new)
CenterOfMassVelocityResidualTpl(const int ndx, const int nu, const Model &model, const Vector3s &frame_vel)
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
Base struct for function data.
Definition fwd.hpp:62
StageFunctionDataTpl< _Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.
Definition fwd.hpp:59