GCC Code Coverage Report


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