aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
multibody-free-fwd.hpp
Go to the documentation of this file.
1
2#pragma once
3
5
6#include <proxsuite-nlp/modelling/spaces/multibody.hpp>
7#include <pinocchio/multibody/data.hpp>
8
9namespace aligator {
10namespace dynamics {
11template <typename Scalar> struct MultibodyFreeFwdDataTpl;
12
23template <typename _Scalar>
25 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
26 using Scalar = _Scalar;
32 using Manifold = proxsuite::nlp::MultibodyPhaseSpace<Scalar>;
33 using ManifoldPtr = xyz::polymorphic<Manifold>;
34
35 using Base::nu_;
36
39
40 const Manifold &space() const { return space_; }
41 int ntau() const { return space_.getModel().nv; }
42
43 MultibodyFreeFwdDynamicsTpl(const Manifold &state, const MatrixXs &actuation);
45
51 bool isUnderactuated() const {
52 long nv = space().getModel().nv;
53 return act_matrix_rank < nv;
54 }
55
56 Eigen::Index getActuationMatrixRank() const { return act_matrix_rank; }
57
58 virtual void forward(const ConstVectorRef &x, const ConstVectorRef &u,
59 BaseData &data) const;
60 virtual void dForward(const ConstVectorRef &x, const ConstVectorRef &u,
61 BaseData &data) const;
62
63 shared_ptr<ContDataAbstract> createData() const;
64
65private:
66 Eigen::FullPivLU<MatrixXs> lu_decomp_;
67 Eigen::Index act_matrix_rank;
68};
69
70template <typename Scalar>
73 using VectorXs = typename math_types<Scalar>::VectorXs;
74 using MatrixXs = typename math_types<Scalar>::MatrixXs;
75 using PinDataType = pinocchio::DataTpl<Scalar>;
81};
82
83} // namespace dynamics
84} // namespace aligator
85
86#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
87#include "aligator/modelling/dynamics/multibody-free-fwd.txx"
88#endif
Main package namespace.
Defines a class representing ODEs.
Data struct for ContinuousDynamicsAbstractTpl.
Definition fwd.hpp:15
MultibodyFreeFwdDataTpl(const MultibodyFreeFwdDynamicsTpl< Scalar > *cont_dyn)
typename math_types< Scalar >::MatrixXs MatrixXs
typename math_types< Scalar >::VectorXs VectorXs
Free-space multibody forward dynamics, using Pinocchio.
virtual void forward(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const
Evaluate the ODE vector field: this returns the value of .
proxsuite::nlp::MultibodyPhaseSpace< Scalar > Manifold
virtual void dForward(const ConstVectorRef &x, const ConstVectorRef &u, BaseData &data) const
Evaluate the vector field Jacobians.
MultibodyFreeFwdDynamicsTpl(const Manifold &state, const MatrixXs &actuation)
shared_ptr< ContDataAbstract > createData() const
Create a data holder instance.
bool isUnderactuated() const
Determine whether the system is underactuated.
Base class for ODE dynamics .