GCC Code Coverage Report


Directory: ./
File: bindings/python/algorithm/expose-crba.cpp
Date: 2024-08-27 18:20:05
Exec Total Coverage
Lines: 5 10 50.0%
Branches: 8 18 44.4%

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 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 data.M.fill(context::Scalar(0));
21 crba(model, data, q, convention);
22 make_symmetric(data.M);
23 return data.M;
24 }
25
26 20 void exposeCRBA()
27 {
28
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
29 "crba", crba_proxy,
30
4/8
✓ Branch 2 taken 20 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 20 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 20 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 20 times.
✗ Branch 12 not taken.
60 (bp::arg("model"), bp::arg("data"), bp::arg("q"),
31
3/6
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 20 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 20 times.
✗ Branch 8 not taken.
40 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 20 }
39
40 } // namespace python
41 } // namespace pinocchio
42