23 const ModelTpl<Scalar, Options> &model, DataTpl<Scalar, Options> &data,
24 const Eigen::MatrixBase<ConfigType> &q, Eigen::MatrixBase<VelType>
const &v,
25 const Eigen::MatrixBase<MatrixType> &actMatrix,
26 const StdVectorEigenAligned<RigidConstraintModelTpl<Scalar, Options>>
28 StdVectorEigenAligned<RigidConstraintDataTpl<Scalar, Options>>
30 const Eigen::MatrixBase<OutType> &res_) {
31 namespace pin = pinocchio;
32 using MatrixXs = Eigen::Matrix<Scalar, -1, -1>;
33 assert(constraint_models.size() == constraint_datas.size() &&
34 "constraint_models and constraint_datas do not have the same size");
36 OutType &res = res_.const_cast_derived();
38 long nu = actMatrix.cols();
40 assert(nv == actMatrix.rows() &&
"Actuation matrix dimension inconsistent.");
42 pin::computeAllTerms(model, data, q, v);
43 const auto &nle = data.nle;
46 for (
size_t k = 0; k < constraint_models.size(); ++k) {
47 d += (int)constraint_models[k].size();
50 assert(res.size() == nu + d);
51 MatrixXs work(nv, nu + d);
53 work.leftCols(nu) = actMatrix;
54 auto JacT = work.rightCols(d);
55 pin::getConstraintsJacobian(model, data, constraint_models, constraint_datas,
59 Eigen::ColPivHouseholderQR<MatrixXs> qr(work);
void underactuatedConstrainedInverseDynamics(const ModelTpl< Scalar, Options > &model, DataTpl< Scalar, Options > &data, const Eigen::MatrixBase< ConfigType > &q, Eigen::MatrixBase< VelType > const &v, const Eigen::MatrixBase< MatrixType > &actMatrix, const StdVectorEigenAligned< RigidConstraintModelTpl< Scalar, Options > > &constraint_models, StdVectorEigenAligned< RigidConstraintDataTpl< Scalar, Options > > &constraint_datas, const Eigen::MatrixBase< OutType > &res_)