Directory: | ./ |
---|---|
File: | bindings/python/parsers/srdf.cpp |
Date: | 2024-08-27 18:20:05 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 14 | 17 | 82.4% |
Branches: | 34 | 72 | 47.2% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2015-2021 CNRS INRIA | ||
3 | // | ||
4 | |||
5 | #include "pinocchio/parsers/srdf.hpp" | ||
6 | #include "pinocchio/bindings/python/parsers/srdf.hpp" | ||
7 | |||
8 | #include <boost/python.hpp> | ||
9 | |||
10 | namespace pinocchio | ||
11 | { | ||
12 | namespace python | ||
13 | { | ||
14 | |||
15 | namespace bp = boost::python; | ||
16 | |||
17 | ✗ | void loadReferenceConfigurationsFromXML( | |
18 | Model & model, const std::string & xmlStream, const bool verbose = false) | ||
19 | { | ||
20 | ✗ | std::istringstream iss(xmlStream); | |
21 | ✗ | pinocchio::srdf::loadReferenceConfigurationsFromXML(model, iss, verbose); | |
22 | } | ||
23 | |||
24 | 20 | void exposeSRDFParser() | |
25 | { | ||
26 | |||
27 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def( |
28 | "removeCollisionPairs", | ||
29 | static_cast<void (*)(const Model &, GeometryModel &, const std::string &, const bool)>( | ||
30 | &srdf::removeCollisionPairs), | ||
31 |
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("geom_model"), bp::arg("srdf_filename"), |
32 |
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("verbose") = false), |
33 | "Parse an SRDF file in order to remove some collision pairs for a specific GeometryModel.\n" | ||
34 | "Parameters:\n" | ||
35 | "Parameters:\n" | ||
36 | "\tmodel: model of the robot\n" | ||
37 | "\tgeom_model: geometry model of the robot\n" | ||
38 | "\tsrdf_filename: path to the SRDF file containing the collision pairs to remove\n" | ||
39 | "\tverbose: [optional] display to the current terminal some internal information"); | ||
40 | |||
41 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def( |
42 | "removeCollisionPairsFromXML", | ||
43 | static_cast<void (*)(const Model &, GeometryModel &, const std::string &, const bool)>( | ||
44 | &srdf::removeCollisionPairsFromXML), | ||
45 |
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("geom_model"), bp::arg("srdf_xml_stream"), |
46 |
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("verbose") = false), |
47 | "Parse an SRDF file in order to remove some collision pairs for a specific GeometryModel.\n" | ||
48 | "Parameters:\n" | ||
49 | "Parameters:\n" | ||
50 | "\tmodel: model of the robot\n" | ||
51 | "\tgeom_model: geometry model of the robot\n" | ||
52 | "\tsrdf_xml_stream: XML stream containing the SRDF information with the collision pairs to " | ||
53 | "remove\n" | ||
54 | "\tverbose: [optional] display to the current terminal some internal information"); | ||
55 | |||
56 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def( |
57 | "loadReferenceConfigurations", | ||
58 | static_cast<void (*)(Model &, const std::string &, const bool)>( | ||
59 | &srdf::loadReferenceConfigurations), | ||
60 |
5/10✓ 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.
✓ Branch 14 taken 20 times.
✗ Branch 15 not taken.
|
40 | (bp::arg("model"), bp::arg("srdf_filename"), bp::arg("verbose") = false), |
61 | "Retrieve all the reference configurations of a given model from the SRDF file.\n" | ||
62 | "Parameters:\n" | ||
63 | "\tmodel: model of the robot\n" | ||
64 | "\tsrdf_filename: path to the SRDF file containing the reference configurations\n" | ||
65 | "\tverbose: [optional] display to the current terminal some internal information"); | ||
66 | |||
67 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def( |
68 | "loadReferenceConfigurationsFromXML", | ||
69 | static_cast<void (*)(Model &, const std::string &, const bool)>( | ||
70 | &srdf::loadReferenceConfigurations), | ||
71 |
5/10✓ 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.
✓ Branch 14 taken 20 times.
✗ Branch 15 not taken.
|
40 | (bp::arg("model"), bp::arg("srdf_xml_stream"), bp::arg("verbose") = false), |
72 | "Retrieve all the reference configurations of a given model from the SRDF file.\n" | ||
73 | "Parameters:\n" | ||
74 | "\tmodel: model of the robot\n" | ||
75 | "\tsrdf_xml_stream: XML stream containing the SRDF information with the reference " | ||
76 | "configurations\n" | ||
77 | "\tverbose: [optional] display to the current terminal some internal information"); | ||
78 | |||
79 |
1/2✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
|
20 | bp::def( |
80 | "loadRotorParameters", | ||
81 | static_cast<bool (*)(Model &, const std::string &, const bool)>(&srdf::loadRotorParameters), | ||
82 |
5/10✓ 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.
✓ Branch 14 taken 20 times.
✗ Branch 15 not taken.
|
40 | (bp::arg("model"), bp::arg("srdf_filename"), bp::arg("verbose") = false), |
83 | "Load the rotor parameters of a given model from a SRDF file.\n" | ||
84 | "Results are stored in model.rotorInertia and model.rotorGearRatio." | ||
85 | "This function also fills the armature of the model." | ||
86 | "Parameters:\n" | ||
87 | "\tmodel: model of the robot\n" | ||
88 | "\tsrdf_filename: path to the SRDF file containing the rotor parameters\n" | ||
89 | "\tverbose: [optional] display to the current terminal some internal information"); | ||
90 | 20 | } | |
91 | } // namespace python | ||
92 | } // namespace pinocchio | ||
93 |