5 #ifndef __pinocchio_python_geometry_data_hpp__
6 #define __pinocchio_python_geometry_data_hpp__
19 #if EIGENPY_VERSION_AT_MOST(2, 8, 1)
33 :
public boost::python::def_visitor<CollisionPairPythonVisitor>
37 if (!register_symbolic_link_to_registered_type<CollisionPair>())
39 bp::class_<CollisionPair>(
40 "CollisionPair",
"Pair of ordered index defining a pair of collisions", bp::no_init)
41 .def(bp::init<>(bp::args(
"self"),
"Empty constructor."))
42 .def(bp::init<const GeomIndex &, const GeomIndex &>(
43 bp::args(
"self",
"index1",
"index2"),
"Initializer of collision pair."))
46 .def(bp::self == bp::self)
47 .def(bp::self != bp::self)
48 .def_readwrite(
"first", &CollisionPair::first)
49 .def_readwrite(
"second", &CollisionPair::second);
52 serialize<std::vector<CollisionPair>>();
61 template<
class PyClass>
65 .def(bp::init<const GeometryModel &>(
66 bp::args(
"self",
"geometry_model"),
"Default constructor from a given GeometryModel."))
69 "oMg", &GeometryData::oMg,
70 "Vector of collision objects placement relative to the world frame.\n"
71 "note: These quantities have to be updated by calling updateGeometryPlacements.")
74 "Vector of active CollisionPairs")
76 #ifdef PINOCCHIO_WITH_HPP_FCL
78 "distanceRequests", &GeometryData::distanceRequests,
79 "Defines which information should be computed by FCL for distance computations")
81 "distanceResults", &GeometryData::distanceResults,
"Vector of distance results.")
83 "collisionRequests", &GeometryData::collisionRequests,
84 "Defines which information should be computed by FCL for collision computations.\n\n"
85 "Note: it is possible to define a security_margin and a break_distance for a collision "
87 "Most likely, for robotics application, these thresholds will be different for each "
89 "(e.g. the two hands can have a large security margin while the two hips cannot.)")
91 "collisionResults", &GeometryData::collisionResults,
"Vector of collision results.")
93 "collision_functors", &GeometryData::collision_functors,
94 "Vector of collision functors.")
96 "distance_functors", &GeometryData::distance_functors,
"Vector of distance functors.")
99 "Vector of radius of bodies, i.e. the distance between the further point of the "
100 "geometry object from the joint center.\n"
101 "note: This radius information might be usuful in continuous collision checking")
102 #endif // PINOCCHIO_WITH_HPP_FCL
106 bp::args(
"self",
"geometry_model"),
"Fill inner and outer objects maps")
108 "activateCollisionPair",
111 bp::args(
"self",
"pair_id"),
112 "Activate the collsion pair pair_id in geomModel.collisionPairs if it exists.\n"
113 "note: Only active pairs are check for collision and distance computations.")
116 bp::args(
"self",
"geom_model",
"geom_id",
"enable_collision"),
117 "Enable or disable collision for the given geometry given by its geometry id with "
118 "all the other geometries registered in the list of collision pairs.")
121 (bp::arg(
"self"), bp::arg(
"geometry_model"), bp::arg(
"collision_map"),
122 bp::arg(
"upper") =
true),
123 "Set the collision pair association from a given input array.\n"
124 "Each entry of the input matrix defines the activation of a given collision pair.")
127 bp::args(
"self",
"pair_id"),
128 "Deactivate the collsion pair pair_id in geomModel.collisionPairs if it exists.")
131 bp::args(
"self"),
"Deactivate all collision pairs.")
132 #ifdef PINOCCHIO_WITH_HPP_FCL
134 "setSecurityMargins", &GeometryData::setSecurityMargins,
135 (bp::arg(
"self"), bp::arg(
"geometry_model"), bp::arg(
"security_margin_map"),
136 bp::arg(
"upper") =
true, bp::arg(
"sync_distance_upper_bound") =
true),
137 "Set the security margin of all the collision request in a row, according to the "
138 "values stored in the associative map.")
139 #endif // PINOCCHIO_WITH_HPP_FCL
141 .def(bp::self == bp::self)
142 .def(bp::self != bp::self)
150 if (!register_symbolic_link_to_registered_type<GeometryData>())
152 bp::class_<GeometryData>(
153 "GeometryData",
"Geometry data linked to a Geometry Model and a Data struct.",
167 #endif // ifndef __pinocchio_python_geometry_data_hpp__