aligator  0.6.1
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>;
21 using Data = CenterOfMassVelocityDataTpl<Scalar>;
22
23 shared_ptr<Model> pin_model_;
24
25 CenterOfMassVelocityResidualTpl(const int ndx, const int nu,
26 const shared_ptr<Model> &model,
27 const Vector3s &frame_vel)
28 : Base(ndx, nu, 3), pin_model_(model), v_ref_(frame_vel) {}
29
30 const Vector3s &getReference() const { return v_ref_; }
31 void setReference(const Eigen::Ref<const Vector3s> &v_new) { v_ref_ = v_new; }
32
33 void evaluate(const ConstVectorRef &x, BaseData &data) const;
34
35 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
36
37 shared_ptr<BaseData> createData() const {
38 return allocate_shared_eigen_aligned<Data>(*this);
39 }
40
41protected:
42 Vector3s v_ref_;
43};
44
45template <typename Scalar>
47 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
48 using Base = StageFunctionDataTpl<Scalar>;
49 using PinData = pinocchio::DataTpl<Scalar>;
50
54 typename math_types<Scalar>::Matrix3Xs fJf_;
55
57 const CenterOfMassVelocityResidualTpl<Scalar> &model);
58};
59
60} // namespace aligator
61
62#include "aligator/modelling/multibody/center-of-mass-velocity.hxx"
63
64#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
65#include "./center-of-mass-velocity.txx"
66#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 shared_ptr< Model > &model, const Vector3s &frame_vel)
CenterOfMassVelocityDataTpl< Scalar > Data
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
Base struct for function data.
const int nu
Control dimension.
StageFunctionDataTpl< Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.