5 #ifndef __pinocchio_python_geometry_model_hpp__ 6 #define __pinocchio_python_geometry_model_hpp__ 12 #include "pinocchio/multibody/geometry.hpp" 23 :
public boost::python::def_visitor< GeometryModelPythonVisitor >
28 template<
class PyClass>
32 .def(bp::init<>(bp::arg(
"self"),
"Default constructor"))
33 .add_property(
"ngeoms", &
GeometryModel::ngeoms,
"Number of geometries contained in the Geometry Model.")
34 .add_property(
"geometryObjects",
37 .def(
"addGeometryObject",
39 bp::args(
"self",
"geometry_object"),
40 "Add a GeometryObject to a GeometryModel.\n" 42 "\tgeometry_object : a GeometryObject\n")
43 .def(
"addGeometryObject",
46 bp::args(
"self",
"geometry_object",
"model"),
47 "Add a GeometryObject to a GeometryModel and set its parent joint by reading its value in the model.\n" 49 "\tgeometry_object : a GeometryObject\n" 50 "\tmodel : a Model of the system\n")
51 .def(
"removeGeometryObject",
53 bp::args(
"self",
"name"),
54 "Remove a GeometryObject. Remove also the collision pairs that contain the object.")
57 bp::args(
"self",
"name"),
58 "Returns the index of a GeometryObject given by its name.")
59 .def(
"existGeometryName",
61 bp::args(
"self",
"name"),
62 "Checks if a GeometryObject given by its name exists.")
66 "Create a GeometryData associated to the current model.")
67 .add_property(
"collisionPairs",
69 "Vector of collision pairs.")
71 bp::args(
"self",
"collision_pair"),
72 "Add a collision pair given by the index of the two collision objects.")
74 "Add all collision pairs.\n" 75 "note : collision pairs between geometries having the same parent joint are not added.")
76 .def(
"setCollisionPairs",
78 setCollisionPairs_overload(bp::args(
"self",
"collision_map",
"upper"),
79 "Set the collision pairs from a given input array.\n" 80 "Each entry of the input matrix defines the activation of a given collision pair" 81 "(map[i,j] == True means that the pair (i,j) is active)."))
83 bp::args(
"self",
"collision_pair"),
84 "Remove a collision pair.")
86 "Remove all collision pairs.")
88 bp::args(
"self",
"collision_pair"),
89 "Check if a collision pair exists.")
91 bp::args(
"self",
"collision_pair"),
92 "Return the index of a collision pair.")
94 .def(bp::self == bp::self)
95 .def(bp::self != bp::self)
107 bp::class_<GeometryModel>(
"GeometryModel",
108 "Geometry model containing the collision or visual geometries associated to a model.",
125 #endif // ifndef __pinocchio_python_geometry_model_hpp__
CollisionPairVector collisionPairs
Vector of collision pairs.
bool existCollisionPair(const CollisionPair &pair) const
Check if a collision pair exists in collisionPairs. See also findCollisitionPair(const CollisionPair ...
Set the Python method str and repr to use the overloading operator<<.
void def(const char *name, Func func)
PairIndex findCollisionPair(const CollisionPair &pair) const
Return the index of a given collision pair in collisionPairs.
void removeCollisionPair(const CollisionPair &pair)
Remove if exists the CollisionPair from the vector collision_pairs.
static GeometryData createData(const GeometryModel &geomModel)
void removeGeometryObject(const std::string &name)
Remove a GeometryObject.
GeometryObjectVector geometryObjects
Vector of GeometryObjects used for collision computations.
GeomIndex getGeometryId(const std::string &name) const
Return the index of a GeometryObject given by its name.
bool existGeometryName(const std::string &name) const
Check if a GeometryObject given by its name exists.
Add the Python method copy to allow a copy of this by calling the copy constructor.
Index ngeoms
The number of GeometryObjects.
void addAllCollisionPairs()
Add all possible collision pairs.
void setCollisionPairs(const MatrixXb &collision_map, const bool upper=true)
Set the collision pairs from a given input array. Each entry of the input matrix defines the activati...
void visit(PyClass &cl) const
Main pinocchio namespace.
void addCollisionPair(const CollisionPair &pair)
Add a collision pair into the vector of collision_pairs. The method check before if the given Collisi...
pinocchio::GeomIndex GeomIndex
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)
void removeAllCollisionPairs()
Remove all collision pairs from collisionPairs. Same as collisionPairs.clear().
GeomIndex addGeometryObject(const GeometryObject &object, const ModelTpl< S2, O2, _JointCollectionTpl > &model)
Add a geometry object to a GeometryModel and set its parent joint.