bindings/python/parsers/mjcf/geometry.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2022 CNRS INRIA
3 //
4 
8 
9 #include <boost/python.hpp>
10 
11 namespace pinocchio
12 {
13  namespace python
14  {
15 
16  namespace bp = boost::python;
17 
18  GeometryModel
19  buildGeomFromMJCF(Model & model, const bp::object & filename, const GeometryType & type)
20  {
21  GeometryModel geometry_model;
23  return geometry_model;
24  }
25 
27  Model & model,
28  const bp::object & filename,
29  const GeometryType & type,
30  ::hpp::fcl::MeshLoaderPtr & meshLoader)
31  {
32  GeometryModel geometry_model;
33  ::pinocchio::mjcf::buildGeom(model, path(filename), type, geometry_model, meshLoader);
34  return geometry_model;
35  }
36 
38  {
39  bp::def(
40  "buildGeomFromMJCF",
41  static_cast<GeometryModel (*)(Model &, const bp::object &, const GeometryType &)>(
43  bp::args("model", "mjcf_filename", "geom_type"),
44  "Parse the Mjcf file given as input looking for the geometry of the given input model and\n"
45  "return a GeometryModel containing either the collision geometries "
46  "(GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
47  "Parameters:\n"
48  "\tmodel: model of the robot\n"
49  "\tfilename: path to the mjcf file containing the model of the robot\n"
50  "\tgeom_type: type of geometry to extract from the mjcf file (either the VISUAL for "
51  "display or the COLLISION for collision detection).\n");
52 
53  bp::def(
54  "buildGeomFromMJCF",
55  static_cast<GeometryModel (*)(
56  Model &, const bp::object &, const GeometryType &, ::hpp::fcl::MeshLoaderPtr &)>(
58  bp::args("model", "mjcf_filename", "geom_type", "mesh_loader"),
59  "Parse the Mjcf file given as input looking for the geometry of the given input model and\n"
60  "return a GeometryModel containing either the collision geometries "
61  "(GeometryType.COLLISION) or the visual geometries (GeometryType.VISUAL).\n"
62  "Parameters:\n"
63  "\tmodel: model of the robot\n"
64  "\tfilename: path to the mjcf file containing the model of the robot\n"
65  "\tgeom_type: type of geometry to extract from the mjcf file (either the VISUAL for "
66  "display or the COLLISION for collision detection).\n"
67  "\tmesh_loader: an hpp-fcl mesh loader (to load only once the related geometries).\n");
68  }
69  } // namespace python
70 } // namespace pinocchio
pinocchio::python::path
std::string path(const bp::object &path)
python pathlib.Path | str -> C++ std::string
Definition: path.cpp:13
common_symbols.type
type
Definition: common_symbols.py:35
boost::python
path.hpp
mjcf.hpp
hpp::fcl::MeshLoaderPtr
std::shared_ptr< MeshLoader > MeshLoaderPtr
Definition: meshloader-fwd.hpp:25
filename
filename
python
mjcf.hpp
pinocchio::mjcf::buildGeom
GeometryModel & buildGeom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const GeometryType type, GeometryModel &geom_model, ::hpp::fcl::MeshLoaderPtr mesh_loader=::hpp::fcl::MeshLoaderPtr())
Build The GeometryModel from a Mjcf file.
pinocchio::GeometryType
GeometryType
Definition: multibody/geometry-object.hpp:24
pinocchio::GeometryModel
Definition: multibody/geometry.hpp:50
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::python::exposeMJCFGeom
void exposeMJCFGeom()
Definition: bindings/python/parsers/mjcf/geometry.cpp:37
pinocchio::model
JointCollectionTpl & model
Definition: joint-configuration.hpp:1082
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27
pinocchio::python::buildGeomFromMJCF
GeometryModel buildGeomFromMJCF(Model &model, const bp::object &filename, const GeometryType &type)
Definition: bindings/python/parsers/mjcf/geometry.cpp:19


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:09