aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
angular-acceleration.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace aligator {
7
8template <typename Scalar> struct AngularAccelerationDataTpl;
9
21template <typename _Scalar>
23
24public:
25 using Scalar = _Scalar;
28 using BaseData = typename Base::Data;
31
32 AngularAccelerationResidualTpl(const int ndx, const int nu, const double mass,
33 const Vector3s &gravity,
34 const ContactMap &contact_map,
35 const int force_size)
36 : Base(ndx, nu, 3), contact_map_(contact_map),
37 nk_(size_t(nu) / size_t(force_size)), mass_(mass), gravity_(gravity),
38 force_size_(force_size) {
39 if (contact_map.size_ != nk_) {
41 fmt::format("Contact ids and nk should be the same: now "
42 "({} and {}).",
43 contact_map.size_, nk_));
44 }
45 }
46
47 void evaluate(const ConstVectorRef &, const ConstVectorRef &u,
48 BaseData &data) const;
49
50 void computeJacobians(const ConstVectorRef &, const ConstVectorRef &,
51 BaseData &data) const;
52
53 shared_ptr<BaseData> createData() const {
54 return std::make_shared<Data>(this);
55 }
56
58
59protected:
60 size_t nk_;
61 double mass_;
62 Vector3s gravity_;
64};
65
66template <typename Scalar>
68 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
70 using Matrix3s = Eigen::Matrix<Scalar, 3, 3>;
71
73
76};
77
78} // namespace aligator
79
80#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
81#include "aligator/modelling/centroidal/angular-acceleration.txx"
82#endif
#define ALIGATOR_DOMAIN_ERROR(msg)
Base definitions for ternary functions.
Main package namespace.
AngularAccelerationDataTpl(const AngularAccelerationResidualTpl< Scalar > *model)
Eigen::Matrix< Scalar, 3, 3 > Matrix3s
This residual returns the angular acceleration of a centroidal model with state , computed from the e...
AngularAccelerationResidualTpl(const int ndx, const int nu, const double mass, const Vector3s &gravity, const ContactMap &contact_map, const int force_size)
shared_ptr< BaseData > createData() const
Instantiate a Data object.
void computeJacobians(const ConstVectorRef &, const ConstVectorRef &, BaseData &data) const
void evaluate(const ConstVectorRef &, const ConstVectorRef &u, BaseData &data) const
Base struct for function data.
Definition fwd.hpp:59
Class representing ternary functions .
Definition fwd.hpp:53
StageFunctionDataTpl< Scalar > Data