Directory: | ./ |
---|---|
File: | bindings/python/algorithm/expose-crba.cpp |
Date: | 2025-02-12 21:03:38 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 10 | 10 | 100.0% |
Branches: | 10 | 19 | 52.6% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2015-2021 CNRS | ||
3 | // | ||
4 | |||
5 | #include "pinocchio/bindings/python/algorithm/algorithms.hpp" | ||
6 | #include "pinocchio/bindings/python/utils/eigen.hpp" | ||
7 | #include "pinocchio/bindings/python/utils/namespace.hpp" | ||
8 | #include "pinocchio/algorithm/crba.hpp" | ||
9 | |||
10 | namespace pinocchio | ||
11 | { | ||
12 | namespace python | ||
13 | { | ||
14 | 12 | static context::MatrixXs crba_proxy( | |
15 | const context::Model & model, | ||
16 | context::Data & data, | ||
17 | const context::VectorXs & q, | ||
18 | const Convention convention) | ||
19 | { | ||
20 |
2/3✓ Branch 1 taken 11 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
12 | data.M.fill(context::Scalar(0)); |
21 | 12 | crba(model, data, q, convention); | |
22 | 12 | make_symmetric(data.M); | |
23 | 12 | return data.M; | |
24 | } | ||
25 | |||
26 | 69 | void exposeCRBA() | |
27 | { | ||
28 |
1/2✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
|
69 | bp::def( |
29 | "crba", crba_proxy, | ||
30 |
4/8✓ Branch 2 taken 69 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 69 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 69 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 69 times.
✗ Branch 12 not taken.
|
207 | (bp::arg("model"), bp::arg("data"), bp::arg("q"), |
31 |
3/6✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 69 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 69 times.
✗ Branch 8 not taken.
|
138 | bp::arg("convention") = pinocchio::Convention::LOCAL), |
32 | "Computes CRBA, store the result in Data and return it.\n" | ||
33 | "Parameters:\n" | ||
34 | "\tmodel: model of the kinematic tree\n" | ||
35 | "\tdata: data related to the model\n" | ||
36 | "\tq: the joint configuration vector (size model.nq)\n" | ||
37 | "\t convention: Convention to use"); | ||
38 | 69 | } | |
39 | |||
40 | } // namespace python | ||
41 | } // namespace pinocchio | ||
42 |