| Directory: | ./ |
|---|---|
| File: | bindings/python/algorithm/expose-cat.cpp |
| Date: | 2025-02-12 21:03:38 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 10 | 10 | 100.0% |
| Branches: | 5 | 11 | 45.5% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2015-2021 CNRS INRIA | ||
| 3 | // | ||
| 4 | |||
| 5 | #include "pinocchio/bindings/python/algorithm/algorithms.hpp" | ||
| 6 | #include "pinocchio/algorithm/compute-all-terms.hpp" | ||
| 7 | |||
| 8 | namespace pinocchio | ||
| 9 | { | ||
| 10 | namespace python | ||
| 11 | { | ||
| 12 | 6 | static void computeAllTerms_proxy( | |
| 13 | const context::Model & model, | ||
| 14 | context::Data & data, | ||
| 15 | const context::VectorXs & q, | ||
| 16 | const context::VectorXs & v) | ||
| 17 | { | ||
| 18 |
1/3✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
6 | data.M.fill(context::Scalar(0)); |
| 19 | 6 | computeAllTerms(model, data, q, v); | |
| 20 |
1/2✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
|
6 | data.M.triangularView<Eigen::StrictlyLower>() = |
| 21 |
2/4✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
|
12 | data.M.transpose().triangularView<Eigen::StrictlyLower>(); |
| 22 | 6 | } | |
| 23 | |||
| 24 | 69 | void exposeCAT() | |
| 25 | { | ||
| 26 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
| 27 | 138 | "computeAllTerms", computeAllTerms_proxy, bp::args("model", "data", "q", "v"), | |
| 28 | "Compute all the terms M, non linear effects, center of mass quantities, centroidal " | ||
| 29 | "quantities and Jacobians in" | ||
| 30 | "in the same loop and store the results in data.\n" | ||
| 31 | "This algorithm is equivalent to calling:\n" | ||
| 32 | "\t- forwardKinematics\n" | ||
| 33 | "\t- crba\n" | ||
| 34 | "\t- nonLinearEffects\n" | ||
| 35 | "\t- computeJointJacobians\n" | ||
| 36 | "\t- centerOfMass\n" | ||
| 37 | "\t- jacobianCenterOfMass\n" | ||
| 38 | "\t- ccrba\n" | ||
| 39 | "\t- computeKineticEnergy\n" | ||
| 40 | "\t- computePotentialEnergy\n" | ||
| 41 | "\t- computeGeneralizedGravity\n" | ||
| 42 | "Parameters:\n" | ||
| 43 | "\tmodel: model of the kinematic tree\n" | ||
| 44 | "\tdata: data related to the model\n" | ||
| 45 | "\tq: the joint configuration vector (size model.nq)\n" | ||
| 46 | "\tv: the joint velocity vector (size model.nv)\n"); | ||
| 47 | 69 | } | |
| 48 | } // namespace python | ||
| 49 | } // namespace pinocchio | ||
| 50 |