aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
wrench-cone.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace aligator {
6
20template <typename Scalar> struct WrenchConeDataTpl;
21
22template <typename _Scalar>
24
25public:
26 using Scalar = _Scalar;
28 using Base = StageFunctionTpl<Scalar>;
29 using BaseData = typename Base::Data;
30 using Data = WrenchConeDataTpl<Scalar>;
31
32 WrenchConeResidualTpl(const int ndx, const int nu, const int k,
33 const double mu, const double half_length,
34 const double half_width)
35 : Base(ndx, nu, 17), k_(k), mu_(mu), hL_(half_length), hW_(half_width) {}
36
37 void evaluate(const ConstVectorRef &, const ConstVectorRef &u,
38 const ConstVectorRef &, BaseData &data) const;
39
40 void computeJacobians(const ConstVectorRef &, const ConstVectorRef &,
41 const ConstVectorRef &, BaseData &data) const;
42
43 shared_ptr<BaseData> createData() const {
44 return allocate_shared_eigen_aligned<Data>(this);
45 }
46
47protected:
48 int k_; // Contact index corresponding to the contact frame
49 double mu_; // Friction coefficient
50 double hL_; // Half-length of the contact frame
51 double hW_; // Half-width of the contact frame
52};
53
54template <typename Scalar>
56 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
57 using Base = StageFunctionDataTpl<Scalar>;
58
59 Eigen::Matrix<Scalar, 17, 6> Jtemp_;
60
61 WrenchConeDataTpl(const WrenchConeResidualTpl<Scalar> *model);
62};
63
64} // namespace aligator
65
66#include "aligator/modelling/centroidal/wrench-cone.hxx"
67
68#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
69#include "./wrench-cone.txx"
70#endif
Base definitions for ternary functions.
Main package namespace.
Base struct for function data.
Class representing ternary functions .
const int nu
Control dimension.
StageFunctionDataTpl< Scalar > Data
This residual implements the wrench cone for a centroidal model with control with 6D spatial force.
Eigen::Matrix< Scalar, 17, 6 > Jtemp_
WrenchConeDataTpl(const WrenchConeResidualTpl< Scalar > *model)
void computeJacobians(const ConstVectorRef &, const ConstVectorRef &, const ConstVectorRef &, BaseData &data) const
WrenchConeDataTpl< Scalar > Data
shared_ptr< BaseData > createData() const
Instantiate a Data object.
WrenchConeResidualTpl(const int ndx, const int nu, const int k, const double mu, const double half_length, const double half_width)
void evaluate(const ConstVectorRef &, const ConstVectorRef &u, const ConstVectorRef &, BaseData &data) const