bindings/python/parsers/srdf.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2020 CNRS INRIA
3 //
4 
5 #include "pinocchio/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  BOOST_PYTHON_FUNCTION_OVERLOADS(removeCollisionPairs_overload,
19  3,4)
20 
21  BOOST_PYTHON_FUNCTION_OVERLOADS(removeCollisionPairsFromXML_overload,
23  3,4)
24 
25  BOOST_PYTHON_FUNCTION_OVERLOADS(loadReferenceConfigurations_overload,
27  2,3)
28 
30  const std::string & xmlStream,
31  const bool verbose = false)
32  {
33  std::istringstream iss (xmlStream);
35  }
36 
37  BOOST_PYTHON_FUNCTION_OVERLOADS(loadReferenceConfigurationsFromXML_overload,
39  2,3)
40 
41  BOOST_PYTHON_FUNCTION_OVERLOADS(loadRotorParameters_overload,
43  2,3)
44 
45  void exposeSRDFParser()
46  {
47 
48  bp::def("removeCollisionPairs",
49  static_cast<void (*)(const Model &, GeometryModel &, const std::string &, const bool)>(&srdf::removeCollisionPairs),
50  removeCollisionPairs_overload(bp::args("model", "geom_model","srdf_filename", "verbose"),
51  "Parse an SRDF file in order to remove some collision pairs for a specific GeometryModel.\n""Parameters:\n"
52  "Parameters:\n"
53  "\tmodel: model of the robot\n"
54  "\tgeom_model: geometry model of the robot\n"
55  "\tsrdf_filename: path to the SRDF file containing the collision pairs to remove\n"
56  "\tverbose: [optional] display to the current terminal some internal information"
57  ));
58 
59  bp::def("removeCollisionPairsFromXML",
60  static_cast<void (*)(const Model &, GeometryModel &, const std::string &, const bool)>(&srdf::removeCollisionPairsFromXML),
61  removeCollisionPairsFromXML_overload(bp::args("model", "geom_model","srdf_xml_stream", "verbose"),
62  "Parse an SRDF file in order to remove some collision pairs for a specific GeometryModel.\n""Parameters:\n"
63  "Parameters:\n"
64  "\tmodel: model of the robot\n"
65  "\tgeom_model: geometry model of the robot\n"
66  "\tsrdf_xml_stream: XML stream containing the SRDF information with the collision pairs to remove\n"
67  "\tverbose: [optional] display to the current terminal some internal information"
68  ));
69 
70  bp::def("loadReferenceConfigurations",
71  static_cast<void (*)(Model &, const std::string &, const bool)>(&srdf::loadReferenceConfigurations),
72  loadReferenceConfigurations_overload(bp::args("model","srdf_filename","verbose"),
73  "Retrieve all the reference configurations of a given model from the SRDF file.\n"
74  "Parameters:\n"
75  "\tmodel: model of the robot\n"
76  "\tsrdf_filename: path to the SRDF file containing the reference configurations\n"
77  "\tverbose: [optional] display to the current terminal some internal information"
78  ));
79 
80  bp::def("loadReferenceConfigurationsFromXML",
81  static_cast<void (*)(Model &, const std::string &, const bool)>(&srdf::loadReferenceConfigurations),
82  loadReferenceConfigurationsFromXML_overload(bp::args("model","srdf_xml_stream","verbose"),
83  "Retrieve all the reference configurations of a given model from the SRDF file.\n"
84  "Parameters:\n"
85  "\tmodel: model of the robot\n"
86  "\tsrdf_xml_stream: XML stream containing the SRDF information with the reference configurations\n"
87  "\tverbose: [optional] display to the current terminal some internal information"
88  ));
89 
90  bp::def("loadRotorParameters",
91  static_cast<bool (*)(Model &, const std::string &, const bool)>(&srdf::loadRotorParameters),
92  loadRotorParameters_overload(bp::args("model","srdf_filename","verbose"),
93  "Load the rotor parameters of a given model from a SRDF file.\n"
94  "Results are stored in model.rotorInertia and model.rotorGearRatio."
95  "Parameters:\n"
96  "\tmodel: model of the robot\n"
97  "\tsrdf_filename: path to the SRDF file containing the rotor parameters\n"
98  "\tverbose: [optional] display to the current terminal some internal information"
99  ));
100  }
101  }
102 }
bool verbose
void loadReferenceConfigurations(ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const bool verbose=false)
Get the reference configurations of a given model associated to a SRDF file. It throws if the SRDF fi...
ModelTpl< double > Model
void removeCollisionPairs(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, GeometryModel &geom_model, const std::string &filename, const bool verbose=false)
Deactive all possible collision pairs mentioned in the SRDF file. It throws if the SRDF file is incor...
void removeCollisionPairsFromXML(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, GeometryModel &geom_model, const std::string &xmlString, const bool verbose=false)
Deactive all possible collision pairs mentioned in the SRDF file.
BOOST_PYTHON_FUNCTION_OVERLOADS(computeKKTContactDynamicMatrixInverse_overload, computeKKTContactDynamicMatrixInverse_proxy, 4, 5) static const Eigen
bool loadRotorParameters(ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const bool verbose=false)
Load the rotor params of a given model associated to a SRDF file. It throws if the SRDF file is incor...
void loadReferenceConfigurationsFromXML(ModelTpl< Scalar, Options, JointCollectionTpl > &model, std::istream &xmlStream, const bool verbose=false)
Get the reference configurations of a given model associated to a SRDF file. It throws if the SRDF fi...
Main pinocchio namespace.
Definition: timings.cpp:28
JointCollectionTpl & model


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:32