GCC Code Coverage Report


Directory: ./
File: bindings/python/algorithm/expose-impulse-dynamics.cpp
Date: 2025-04-30 16:14:33
Exec Total Coverage
Lines: 7 10 70.0%
Branches: 19 42 45.2%

Line Branch Exec Source
1 //
2 // Copyright (c) 2020-2021 CNRS INRIA
3 //
4
5 #include "pinocchio/bindings/python/algorithm/algorithms.hpp"
6 #include "pinocchio/bindings/python/utils/std-vector.hpp"
7 #include "pinocchio/bindings/python/utils/model-checker.hpp"
8
9 #include "pinocchio/algorithm/impulse-dynamics.hpp"
10
11 namespace bp = boost::python;
12
13 namespace pinocchio
14 {
15 namespace python
16 {
17
18 #ifndef PINOCCHIO_PYTHON_SKIP_ALGORITHM_IMPULSE_DYNAMICS
19 typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(context::RigidConstraintModel)
20 RigidConstraintModelVector;
21 typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(context::RigidConstraintData)
22 RigidConstraintDataVector;
23
24 static const context::VectorXs impulseDynamics_proxy(
25 const context::Model & model,
26 context::Data & data,
27 const context::VectorXs & q,
28 const context::VectorXs & v,
29 const RigidConstraintModelVector & contact_models,
30 RigidConstraintDataVector & contact_datas,
31 const context::Scalar r_coeff,
32 const context::ProximalSettings & prox_settings)
33 {
34 return impulseDynamics(
35 model, data, q, v, contact_models, contact_datas, r_coeff, prox_settings);
36 }
37 #endif // PINOCCHIO_PYTHON_SKIP_ALGORITHM_IMPULSE_DYNAMICS
38
39 72 void exposeImpulseDynamics()
40 {
41 #ifndef PINOCCHIO_PYTHON_SKIP_ALGORITHM_IMPULSE_DYNAMICS
42
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
72 bp::def(
43 "impulseDynamics", impulseDynamics_proxy,
44
10/20
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 72 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 72 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 72 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 72 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 72 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 72 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 72 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 72 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 72 times.
✗ Branch 29 not taken.
216 (bp::arg("model"), bp::arg("data"), bp::arg("q"), bp::arg("v"), bp::arg("contact_models"),
45
4/8
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 72 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 72 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 72 times.
✗ Branch 11 not taken.
288 bp::arg("contact_datas"), bp::arg("r_coeff") = 0,
46
4/8
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 72 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 72 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 72 times.
✗ Branch 11 not taken.
144 bp::arg("prox_settings") = context::ProximalSettings()),
47 "Computes the impulse dynamics with contact constraints according to a given list of "
48 "Contact information.\n"
49 "When using impulseDynamics for the first time, you should call first "
50 "initConstraintDynamics to initialize the internal memory used in the algorithm.\n"
51 "This function returns the after-impulse velocity of the system. The impulses acting "
52 "on the contacts are stored in the list data.contact_forces.",
53 72 mimic_not_supported_function<>(0));
54 #endif // PINOCCHIO_PYTHON_SKIP_ALGORITHM_IMPULSE_DYNAMICS
55 72 }
56 } // namespace python
57 } // namespace pinocchio
58