| Directory: | ./ |
|---|---|
| File: | bindings/python/algorithm/expose-impulse-dynamics-derivatives.cpp |
| Date: | 2025-04-30 16:14:33 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 6 | 9 | 66.7% |
| Branches: | 15 | 32 | 46.9% |
| 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/algorithm/impulse-dynamics-derivatives.hpp" | ||
| 7 | #include "pinocchio/algorithm/proximal.hpp" | ||
| 8 | #include "pinocchio/bindings/python/utils/std-vector.hpp" | ||
| 9 | #include "pinocchio/bindings/python/utils/model-checker.hpp" | ||
| 10 | |||
| 11 | namespace bp = boost::python; | ||
| 12 | |||
| 13 | namespace pinocchio | ||
| 14 | { | ||
| 15 | namespace python | ||
| 16 | { | ||
| 17 | |||
| 18 | typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(context::RigidConstraintModel) | ||
| 19 | RigidConstraintModelVector; | ||
| 20 | typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(context::RigidConstraintData) | ||
| 21 | RigidConstraintDataVector; | ||
| 22 | |||
| 23 | ✗ | static void impulseDynamicsDerivatives_proxy( | |
| 24 | const context::Model & model, | ||
| 25 | context::Data & data, | ||
| 26 | const RigidConstraintModelVector & contact_models, | ||
| 27 | RigidConstraintDataVector & contact_datas, | ||
| 28 | const context::Scalar & r_coeff, | ||
| 29 | const context::ProximalSettings & prox_settings) | ||
| 30 | { | ||
| 31 | ✗ | computeImpulseDynamicsDerivatives( | |
| 32 | model, data, contact_models, contact_datas, r_coeff, prox_settings); | ||
| 33 | ✗ | return; | |
| 34 | } | ||
| 35 | |||
| 36 | 72 | void exposeImpulseDynamicsDerivatives() | |
| 37 | { | ||
| 38 |
1/2✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
|
72 | bp::def( |
| 39 | "computeImpulseDynamicsDerivatives", impulseDynamicsDerivatives_proxy, | ||
| 40 |
7/14✓ 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.
|
144 | (bp::arg("model"), bp::arg("data"), bp::arg("contact_models"), bp::arg("contact_datas"), |
| 41 |
7/14✓ 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.
|
144 | bp::arg("r_coeff") = 0, bp::arg("prox_settings") = context::ProximalSettings()), |
| 42 | "Computes the impulse dynamics derivatives with contact constraints according to a " | ||
| 43 | "given list of Contact information.\n" | ||
| 44 | "impulseDynamics should have been called before.", | ||
| 45 | 72 | mimic_not_supported_function<>(0)); | |
| 46 | 72 | } | |
| 47 | } // namespace python | ||
| 48 | } // namespace pinocchio | ||
| 49 |