bindings/python/parsers/urdf/geometry.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2020 CNRS INRIA
3 //
4 
5 #include "pinocchio/parsers/urdf.hpp"
7 
8 #include <boost/python.hpp>
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14 
15  namespace bp = boost::python;
16 
17 #ifdef PINOCCHIO_WITH_URDFDOM
18 
19  GeometryModel
21  const std::string & filename,
22  const GeometryType type)
23  {
24  GeometryModel geometry_model;
25  pinocchio::urdf::buildGeom(model,filename,type,geometry_model);
26 
27  return geometry_model;
28  }
29 
30  GeometryModel &
32  const std::string & filename,
33  const GeometryType type,
34  GeometryModel & geometry_model)
35  {
36  pinocchio::urdf::buildGeom(model,filename,type,geometry_model);
37  return geometry_model;
38  }
39 
40  GeometryModel
42  const std::string & filename,
43  const GeometryType type,
44  const std::vector<std::string> & package_dirs)
45  {
46  GeometryModel geometry_model;
47  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dirs);
48 
49  return geometry_model;
50  }
51 
52  GeometryModel &
54  const std::string & filename,
55  const GeometryType type,
56  GeometryModel & geometry_model,
57  const std::vector<std::string> & package_dirs)
58  {
59  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dirs);
60 
61  return geometry_model;
62  }
63 
64  GeometryModel
66  const std::string & filename,
67  const GeometryType type,
68  const std::string & package_dir)
69  {
70  GeometryModel geometry_model;
71  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dir);
72 
73  return geometry_model;
74  }
75 
76  GeometryModel &
78  const std::string & filename,
79  const GeometryType type,
80  GeometryModel & geometry_model,
81  const std::string & package_dir)
82  {
83  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dir);
84 
85  return geometry_model;
86  }
87 
88 #ifdef PINOCCHIO_WITH_HPP_FCL
89  GeometryModel
91  const std::string & filename,
92  const GeometryType type,
93  const fcl::MeshLoaderPtr & meshLoader)
94  {
95  std::vector<std::string> hints;
96  GeometryModel geometry_model;
97  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,hints,meshLoader);
98 
99  return geometry_model;
100  }
101 
102  GeometryModel &
103  buildGeomFromUrdf(const Model & model,
104  const std::string & filename,
105  const GeometryType type,
106  GeometryModel & geometry_model,
107  const fcl::MeshLoaderPtr & meshLoader)
108  {
109  std::vector<std::string> hints;
110  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,hints,meshLoader);
111 
112  return geometry_model;
113  }
114 
115  GeometryModel
116  buildGeomFromUrdf(const Model & model,
117  const std::string & filename,
118  const GeometryType type,
119  const std::vector<std::string> & package_dirs,
120  const fcl::MeshLoaderPtr & meshLoader)
121  {
122  GeometryModel geometry_model;
123  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dirs,meshLoader);
124 
125  return geometry_model;
126  }
127 
128  GeometryModel &
129  buildGeomFromUrdf(const Model & model,
130  const std::string & filename,
131  const GeometryType type,
132  GeometryModel & geometry_model,
133  const std::vector<std::string> & package_dirs,
134  const fcl::MeshLoaderPtr & meshLoader)
135  {
136  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dirs,meshLoader);
137 
138  return geometry_model;
139  }
140 
141  GeometryModel
142  buildGeomFromUrdf(const Model & model,
143  const std::string & filename,
144  const GeometryType type,
145  const std::string & package_dir,
146  const fcl::MeshLoaderPtr & meshLoader)
147  {
148  GeometryModel geometry_model;
149  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dir,meshLoader);
150 
151  return geometry_model;
152  }
153 
154  GeometryModel &
155  buildGeomFromUrdf(const Model & model,
156  const std::string & filename,
157  const GeometryType type,
158  GeometryModel & geometry_model,
159  const std::string & package_dir,
160  const fcl::MeshLoaderPtr & meshLoader)
161  {
162  pinocchio::urdf::buildGeom(model,filename,type,geometry_model,package_dir,meshLoader);
163 
164  return geometry_model;
165  }
166 
167 #endif // #ifdef PINOCCHIO_WITH_HPP_FCL
168 #endif
169 
171  {
172 
173 #ifdef PINOCCHIO_WITH_URDFDOM
174 
175  bp::def("buildGeomFromUrdf",
176  static_cast <GeometryModel (*) (const Model &, const std::string &, const GeometryType, const std::vector<std::string> &)> (pinocchio::python::buildGeomFromUrdf),
177  bp::args("model","urdf_filename","geom_type","package_dirs"),
178  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
179  "return a GeometryModel containing either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
180  "Parameters:\n"
181  "\tmodel: model of the robot\n"
182  "\turdf_filename: path to the URDF file containing the model of the robot\n"
183  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
184  "\tpackage_dirs: vector of paths pointing to the folders containing the model of the robot\n"
185  );
186 
187  bp::def("buildGeomFromUrdf",
188  static_cast <GeometryModel & (*) (const Model &, const std::string &, const GeometryType, GeometryModel &, const std::vector<std::string> &)> (pinocchio::python::buildGeomFromUrdf),
189  bp::args("model","urdf_filename","geom_type","geom_model","package_dirs"),
190  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
191  "and store either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL) in the geom_model given as input.\n"
192  "Parameters:\n"
193  "\tmodel: model of the robot\n"
194  "\turdf_filename: path to the URDF file containing the model of the robot\n"
195  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
196  "\tgeom_model: reference where to store the parsed information\n"
197  "\tpackage_dirs: vector of paths pointing to the folders containing the model of the robot\n",
198  bp::return_internal_reference<4>()
199  );
200 
201  bp::def("buildGeomFromUrdf",
202  static_cast <GeometryModel (*) (const Model &, const std::string &, const GeometryType)> (pinocchio::python::buildGeomFromUrdf),
203  bp::args("model","urdf_filename","geom_type"),
204  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
205  "return a GeometryModel containing either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
206  "Parameters:\n"
207  "\tmodel: model of the robot\n"
208  "\turdf_filename: path to the URDF file containing the model of the robot\n"
209  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
210  "Note:\n"
211  "This function does not take any hint concerning the location of the meshes of the robot."
212  );
213 
214  bp::def("buildGeomFromUrdf",
215  static_cast <GeometryModel & (*) (const Model &, const std::string &, const GeometryType, GeometryModel &)> (pinocchio::python::buildGeomFromUrdf),
216  bp::args("model","urdf_filename","geom_type","geom_model"),
217  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
218  "and store either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL) in the geom_model given as input.\n"
219  "Parameters:\n"
220  "\tmodel: model of the robot\n"
221  "\turdf_filename: path to the URDF file containing the model of the robot\n"
222  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
223  "\tgeom_model: reference where to store the parsed information\n"
224  "Note:\n"
225  "This function does not take any hint concerning the location of the meshes of the robot.",
226  bp::return_internal_reference<4>()
227  );
228 
229  bp::def("buildGeomFromUrdf",
230  static_cast <GeometryModel (*) (const Model &, const std::string &, const GeometryType, const std::string &)> (pinocchio::python::buildGeomFromUrdf),
231  bp::args("model","urdf_filename","geom_type","package_dir" ),
232  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
233  "return a GeometryModel containing either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
234  "Parameters:\n"
235  "\tmodel: model of the robot\n"
236  "\turdf_filename: path to the URDF file containing the model of the robot\n"
237  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
238  "\tpackage_dir: path pointing to the folder containing the meshes of the robot\n"
239  );
240 
241  bp::def("buildGeomFromUrdf",
242  static_cast <GeometryModel & (*) (const Model &, const std::string &, const GeometryType, GeometryModel &, const std::string &)> (pinocchio::python::buildGeomFromUrdf),
243  bp::args("model","urdf_filename","geom_type","geom_model","package_dir"),
244  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
245  "and store either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL) in the geom_model given as input.\n"
246  "Parameters:\n"
247  "\tmodel: model of the robot\n"
248  "\turdf_filename: path to the URDF file containing the model of the robot\n"
249  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
250  "\tgeom_model: reference where to store the parsed information\n"
251  "\tpackage_dir: path pointing to the folder containing the meshes of the robot\n",
252  bp::return_internal_reference<4>()
253  );
254 
255 #ifdef PINOCCHIO_WITH_HPP_FCL
256 
257  bp::def("buildGeomFromUrdf",
258  static_cast <GeometryModel (*) (const Model &, const std::string &, const GeometryType, const std::vector<std::string> &, const fcl::MeshLoaderPtr&)> (pinocchio::python::buildGeomFromUrdf),
259  bp::args("model","urdf_filename","geom_type","package_dirs","mesh_loader"),
260  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
261  "return a GeometryModel containing either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
262  "Parameters:\n"
263  "\tmodel: model of the robot\n"
264  "\turdf_filename: path to the URDF file containing the model of the robot\n"
265  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
266  "\tpackage_dirs: vector of paths pointing to the folders containing the model of the robot\n"
267  "\tmesh_loader: an hpp-fcl mesh loader (to load only once the related geometries)."
268  );
269 
270  bp::def("buildGeomFromUrdf",
271  static_cast <GeometryModel & (*) (const Model &, const std::string &, const GeometryType, GeometryModel &, const std::vector<std::string> &, const fcl::MeshLoaderPtr&)> (pinocchio::python::buildGeomFromUrdf),
272  bp::args("model","urdf_filename","geom_type","geom_model","package_dirs","mesh_loader"),
273  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
274  "and store either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL) in the geom_model given as input.\n"
275  "Parameters:\n"
276  "\tmodel: model of the robot\n"
277  "\turdf_filename: path to the URDF file containing the model of the robot\n"
278  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
279  "\tgeom_model: reference where to store the parsed information\n"
280  "\tpackage_dirs: vector of paths pointing to the folders containing the model of the robot\n"
281  "\tmesh_loader: an hpp-fcl mesh loader (to load only once the related geometries).",
282  bp::return_internal_reference<4>()
283  );
284 
285  bp::def("buildGeomFromUrdf",
286  static_cast <GeometryModel (*) (const Model &, const std::string &, const GeometryType, const std::string &, const fcl::MeshLoaderPtr&)> (pinocchio::python::buildGeomFromUrdf),
287  bp::args("model","urdf_filename","geom_type","package_dir","mesh_loader"),
288  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
289  "return a GeometryModel containing either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
290  "Parameters:\n"
291  "\tmodel: model of the robot\n"
292  "\turdf_filename: path to the URDF file containing the model of the robot\n"
293  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
294  "\tpackage_dir: path pointing to the folder containing the meshes of the robot\n"
295  "\tmesh_loader: an hpp-fcl mesh loader (to load only once the related geometries)."
296  );
297 
298  bp::def("buildGeomFromUrdf",
299  static_cast <GeometryModel & (*) (const Model &, const std::string &, const GeometryType, GeometryModel &, const std::string &, const fcl::MeshLoaderPtr&)> (pinocchio::python::buildGeomFromUrdf),
300  bp::args("model","urdf_filename","geom_type","geom_model","package_dir","mesh_loader"),
301  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
302  "and store either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL) in the geom_model given as input.\n"
303  "Parameters:\n"
304  "\tmodel: model of the robot\n"
305  "\turdf_filename: path to the URDF file containing the model of the robot\n"
306  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
307  "\tgeom_model: reference where to store the parsed information\n"
308  "\tpackage_dir: path pointing to the folder containing the meshes of the robot\n"
309  "\tmesh_loader: an hpp-fcl mesh loader (to load only once the related geometries).",
310  bp::return_internal_reference<4>()
311  );
312 
313  bp::def("buildGeomFromUrdf",
314  static_cast <GeometryModel (*) (const Model &, const std::string &, const GeometryType, const fcl::MeshLoaderPtr&)> (pinocchio::python::buildGeomFromUrdf),
315  bp::args("model","urdf_filename","geom_type","mesh_loader"),
316  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
317  "return a GeometryModel containing either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
318  "Parameters:\n"
319  "\tmodel: model of the robot\n"
320  "\turdf_filename: path to the URDF file containing the model of the robot\n"
321  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
322  "\tmesh_loader: an hpp-fcl mesh loader (to load only once the related geometries).\n"
323  "Note:\n"
324  "This function does not take any hint concerning the location of the meshes of the robot."
325  );
326 
327  bp::def("buildGeomFromUrdf",
328  static_cast <GeometryModel & (*) (const Model &, const std::string &, const GeometryType, GeometryModel &, const fcl::MeshLoaderPtr&)> (pinocchio::python::buildGeomFromUrdf),
329  bp::args("model","urdf_filename","geom_type","geom_model","mesh_loader"),
330  "Parse the URDF file given as input looking for the geometry of the given input model and\n"
331  "and store either the collision geometries (GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL) in the geom_model given as input.\n"
332  "Parameters:\n"
333  "\tmodel: model of the robot\n"
334  "\turdf_filename: path to the URDF file containing the model of the robot\n"
335  "\tgeom_type: type of geometry to extract from the URDF file (either the VISUAL for display or the COLLISION for collision detection).\n"
336  "\tgeom_model: reference where to store the parsed information\n"
337  "\tmesh_loader: an hpp-fcl mesh loader (to load only once the related geometries).\n"
338  "Note:\n"
339  "This function does not take any hint concerning the location of the meshes of the robot.",
340  bp::return_internal_reference<4>()
341  );
342 
343 #endif // #ifdef PINOCCHIO_WITH_HPP_FCL
344 #endif // #ifdef PINOCCHIO_WITH_URDFDOM
345  }
346  }
347 }
348 
GeometryType
Definition: fcl.hpp:112
ModelTpl< double > Model
def buildGeomFromUrdf(model, filename, args)
Definition: deprecated.py:107
GeometryModel & buildGeom(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const GeometryType type, GeometryModel &geom_model, const std::vector< std::string > &package_paths=std::vector< std::string >(),::hpp::fcl::MeshLoaderPtr mesh_loader=::hpp::fcl::MeshLoaderPtr())
Build The GeometryModel from a URDF file. Search for meshes in the directories specified by the user ...
Main pinocchio namespace.
Definition: timings.cpp:30
JointCollectionTpl & model


pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:03