GCC Code Coverage Report


Directory: ./
File: bindings/python/algorithm/expose-centroidal.cpp
Date: 2024-08-27 18:20:05
Exec Total Coverage
Lines: 19 26 73.1%
Branches: 16 32 50.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2015-2020 CNRS INRIA
3 //
4
5 #include "pinocchio/bindings/python/algorithm/algorithms.hpp"
6 #include "pinocchio/algorithm/centroidal.hpp"
7
8 namespace pinocchio
9 {
10 namespace python
11 {
12
13 20 void exposeCentroidal()
14 {
15 typedef context::Scalar Scalar;
16 typedef context::VectorXs VectorXs;
17 enum
18 {
19 Options = context::Options
20 };
21
22
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
23 "computeCentroidalMomentum",
24 &computeCentroidalMomentum<Scalar, Options, JointCollectionDefaultTpl>,
25
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data"),
26 "Computes the Centroidal momentum, a.k.a. the total momentum of the system expressed "
27 "around the center of mass.",
28 bp::return_value_policy<bp::return_by_value>());
29
30
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
31 "computeCentroidalMomentum",
32 &computeCentroidalMomentum<Scalar, Options, JointCollectionDefaultTpl, VectorXs, VectorXs>,
33
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data", "q", "v"),
34 "Computes the Centroidal momentum, a.k.a. the total momentum of the system expressed "
35 "around the center of mass.",
36 bp::return_value_policy<bp::return_by_value>());
37
38
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
39 "computeCentroidalMomentumTimeVariation",
40 &computeCentroidalMomentumTimeVariation<Scalar, Options, JointCollectionDefaultTpl>,
41
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data"),
42 "Computes the Centroidal momentum and its time derivatives, a.k.a. the total "
43 "momentum of the system and its time derivative expressed around the center of mass.",
44 bp::return_value_policy<bp::return_by_value>());
45
46
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
47 "computeCentroidalMomentumTimeVariation",
48 &computeCentroidalMomentumTimeVariation<
49 Scalar, Options, JointCollectionDefaultTpl, VectorXs, VectorXs, VectorXs>,
50
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data", "q", "v", "a"),
51 "Computes the Centroidal momentum and its time derivatives, a.k.a. the total "
52 "momentum of the system and its time derivative expressed around the center of mass.",
53 bp::return_value_policy<bp::return_by_value>());
54
55
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
56 "ccrba", &ccrba<Scalar, Options, JointCollectionDefaultTpl, VectorXs, VectorXs>,
57
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data", "q", "v"),
58 "Computes the centroidal mapping, the centroidal momentum and the Centroidal Composite "
59 "Rigid Body Inertia, puts the result in Data and returns the centroidal mapping."
60 "For the same price, it also computes the total joint jacobians (data.J).",
61 bp::return_value_policy<bp::return_by_value>());
62
63
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
64 "computeCentroidalMap",
65 &computeCentroidalMap<Scalar, Options, JointCollectionDefaultTpl, VectorXs>,
66
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data", "q"),
67 "Computes the centroidal mapping, puts the result in Data.Ag and returns the "
68 "centroidal mapping.\n"
69 "For the same price, it also computes the total joint jacobians (data.J).",
70 bp::return_value_policy<bp::return_by_value>());
71
72
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
73 "dccrba", dccrba<Scalar, Options, JointCollectionDefaultTpl, VectorXs, VectorXs>,
74
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data", "q", "v"),
75 "Computes the time derivative of the centroidal momentum matrix Ag in terms of q and v.\n"
76 "For the same price, it also computes the centroidal momentum matrix (data.Ag), the total "
77 "joint jacobians (data.J) "
78 "and the related joint jacobians time derivative (data.dJ)",
79 bp::return_value_policy<bp::return_by_value>());
80
81
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
20 bp::def(
82 "computeCentroidalMapTimeVariation",
83 computeCentroidalMapTimeVariation<
84 Scalar, Options, JointCollectionDefaultTpl, VectorXs, VectorXs>,
85
1/2
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
40 bp::args("model", "data", "q", "v"),
86 "Computes the time derivative of the centroidal momentum matrix Ag, puts the result "
87 "in Data.Ag and returns the centroidal mapping.\n"
88 "For the same price, it also computes the centroidal momentum matrix (data.Ag), the "
89 "total joint jacobians (data.J) "
90 "and the related joint jacobians time derivative (data.dJ)",
91 20 bp::return_value_policy<bp::return_by_value>());
92 20 }
93
94 } // namespace python
95 } // namespace pinocchio
96