aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
dcm-position.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 DCMPositionDataTpl;
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 DCMPositionResidualTpl(const int ndx, const int nu, const Model &model,
26 const Vector3s &dcm_ref, const double alpha)
27 : Base(ndx, nu, 3), pin_model_(model), dcm_ref_(dcm_ref), alpha_(alpha) {}
28
29 const Vector3s &getReference() const { return dcm_ref_; }
30 void setReference(const Eigen::Ref<const Vector3s> &new_ref) {
31 dcm_ref_ = new_ref;
32 }
33
34 void evaluate(const ConstVectorRef &x, BaseData &data) const;
35
36 void computeJacobians(const ConstVectorRef &x, BaseData &data) const;
37
38 shared_ptr<BaseData> createData() const {
39 return std::make_shared<Data>(*this);
40 }
41
42protected:
43 Vector3s dcm_ref_;
44 double alpha_;
45};
46
47template <typename Scalar>
49 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
51 using PinData = pinocchio::DataTpl<Scalar>;
52
56 typename math_types<Scalar>::Matrix3Xs fJf_;
57
59};
60
61} // namespace aligator
62
63#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
64#include "./dcm-position.txx"
65#endif
Main package namespace.
math_types< Scalar >::Matrix3Xs fJf_
Jacobian of the error.
pinocchio::DataTpl< Scalar > PinData
PinData pin_data_
Pinocchio data object.
DCMPositionDataTpl(const DCMPositionResidualTpl< Scalar > &model)
DCMPositionResidualTpl(const int ndx, const int nu, const Model &model, const Vector3s &dcm_ref, const double alpha)
pinocchio::ModelTpl< Scalar > Model
pinocchio::SE3Tpl< Scalar > SE3
void computeJacobians(const ConstVectorRef &x, BaseData &data) const
void setReference(const Eigen::Ref< const Vector3s > &new_ref)
shared_ptr< BaseData > createData() const
Instantiate a Data object.
void evaluate(const ConstVectorRef &x, BaseData &data) const
const Vector3s & getReference() const
Base struct for function data.
Definition fwd.hpp:59
StageFunctionDataTpl< _Scalar > Data
Represents unary functions of the form , with no control (or next-state) arguments.
Definition fwd.hpp:56