Go to the documentation of this file.
21 int main(
int argc,
const char ** argv)
23 using namespace Eigen;
28 const int NBT = 1000 * 100;
31 std::cout <<
"(the time score in debug mode is not relevant) " << std::endl;
43 std::cout <<
"nq = " <<
model.nq << std::endl;
46 VectorXd qmax = Eigen::VectorXd::Ones(
model.nq);
55 for (
size_t i = 0;
i < NBT; ++
i)
58 lhs[
i] = Eigen::VectorXd::Zero(
model.nv);
59 rhs[
i] = Eigen::VectorXd::Random(
model.nv);
74 Eigen::LDLT<Eigen::MatrixXd> Mldlt(
data.M);
78 data.M.triangularView<Eigen::StrictlyLower>() =
79 data.M.transpose().triangularView<Eigen::StrictlyLower>();
81 Mldlt.compute(
data.M);
84 std::cout <<
"Dense Eigen Cholesky = \t" << (total / NBT) <<
" "
92 std::cout <<
"Cholesky solve vector = \t\t";
93 timer.
toc(std::cout, NBT);
100 std::cout <<
"UDUtv = \t\t";
101 timer.
toc(std::cout, NBT);
110 std::cout <<
"Minv from cholesky = \t\t";
111 timer.
toc(std::cout, NBT);
118 std::cout <<
"Cholesky solve column = \t\t";
119 timer.
toc(std::cout, NBT);
124 lhs[_smooth].noalias() = Minv *
rhs[_smooth];
126 std::cout <<
"Minv*v = \t\t";
127 timer.
toc(std::cout, NBT);
132 A.noalias() = Minv *
B;
134 std::cout <<
"A = Minv*B = \t\t";
135 timer.
toc(std::cout, NBT);
137 data.M.triangularView<Eigen::StrictlyLower>() =
138 data.M.transpose().triangularView<Eigen::StrictlyLower>();
142 A.noalias() =
data.M.inverse();
144 std::cout <<
"M.inverse() = \t\t";
145 timer.
toc(std::cout, NBT);
152 std::cout <<
"computeMinverse = \t\t";
153 timer.
toc(std::cout, NBT);
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
int main(int argc, const char **argv)
JointModelFreeFlyerTpl< Scalar > JointModelFreeFlyer
const DataTpl< Scalar, Options, JointCollectionTpl >::MatrixXs & crba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Convention convention=Convention::LOCAL)
Computes the upper triangular part of the joint space inertia matrix M by using the Composite Rigid B...
static std::string unitName(Unit u)
Mat & UDUtv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &m)
Performs the multiplication by using the Cholesky decomposition of M stored in data.
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
const DataTpl< Scalar, Options, JointCollectionTpl >::RowMatrixXs & computeMinverse(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
Computes the inverse of the joint space inertia matrix using Articulated Body formulation.
Mat & solve(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &y)
Return the solution of using the Cholesky decomposition stored in data given the entry ....
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModel(const std::string &filename, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, const std::string &rootJointName, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false)
Build the model from a URDF file with a particular joint as root of the model tree inside the model g...
const DataTpl< Scalar, Options, JointCollectionTpl >::MatrixXs & decompose(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Compute the Cholesky decomposition of the joint space inertia matrix M contained in data.
Mat & computeMinv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &Minv)
Computes the inverse of the joint space inertia matrix M from its Cholesky factorization.
#define PINOCCHIO_ALIGNED_STD_VECTOR(Type)
Main pinocchio namespace.
#define PINOCCHIO_MODEL_DIR
pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:12