5 #ifndef __pinocchio_python_geometry_data_hpp__ 6 #define __pinocchio_python_geometry_data_hpp__ 10 #include "pinocchio/serialization/geometry.hpp" 30 :
public boost::python::def_visitor<CollisionPairPythonVisitor>
34 bp::class_<CollisionPair> (
"CollisionPair",
35 "Pair of ordered index defining a pair of collisions",
39 "Empty constructor."))
40 .
def(bp::init<const GeomIndex &, const GeomIndex &>
41 (bp::args(
"self",
"index1",
"index2"),
42 "Initializer of collision pair."))
45 .
def(bp::self == bp::self)
46 .def(bp::self != bp::self)
47 .def_readwrite(
"first",&CollisionPair::first)
48 .def_readwrite(
"second",&CollisionPair::second);
51 serialize< std::vector<CollisionPair> >();
56 :
public boost::python::def_visitor< GeometryDataPythonVisitor >
60 template<
class PyClass>
64 .def(bp::init<GeometryModel>(bp::args(
"self",
"geometry_model"),
65 "Default constructor from a given GeometryModel"))
69 "Vector of collision objects placement relative to the world frame.\n" 70 "note: These quantities have to be updated by calling updateGeometryPlacements.")
71 .def_readonly(
"activeCollisionPairs",
73 "Vector of active CollisionPairs")
75 #ifdef PINOCCHIO_WITH_HPP_FCL 76 .def_readonly(
"distanceRequests",
77 &GeometryData::distanceRequests,
78 "Defines which information should be computed by FCL for distance computations")
79 .def_readonly(
"distanceResults",
80 &GeometryData::distanceResults,
81 "Vector of distance results.")
82 .def_readonly(
"collisionRequests",
83 &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 request.\n" 86 "Most likely, for robotics application, these thresholds will be different for each collision pairs\n" 87 "(e.g. the two hands can have a large security margin while the two hips cannot.)")
88 .def_readonly(
"collisionResults",
89 &GeometryData::collisionResults,
90 "Vector of collision results.")
91 .def_readonly(
"radius",
93 "Vector of radius of bodies, i.e. the distance between the further point of the geometry object from the joint center.\n" 94 "note: This radius information might be usuful in continuous collision checking")
95 #endif // PINOCCHIO_WITH_HPP_FCL 97 .def(
"fillInnerOuterObjectMaps",
99 bp::args(
"self",
"geometry_model"),
100 "Fill inner and outer objects maps")
101 .def(
"activateCollisionPair",
103 bp::args(
"self",
"pair_id"),
104 "Activate the collsion pair pair_id in geomModel.collisionPairs if it exists.\n" 105 "note: Only active pairs are check for collision and distance computations.")
106 .def(
"setGeometryCollisionStatus",
108 bp::args(
"self",
"geom_model",
"geom_id",
"enable_collision"),
109 "Enable or disable collision for the given geometry given by its geometry id with all the other geometries registered in the list of collision pairs.")
110 .def(
"setActiveCollisionPairs",
112 setActiveCollisionPairs_overload(bp::args(
"self",
"geometry_model",
"collision_map",
"upper"),
113 "Set the collision pair association from a given input array.\n" 114 "Each entry of the input matrix defines the activation of a given collision pair."))
115 .def(
"deactivateCollisionPair",
117 bp::args(
"self",
"pair_id"),
118 "Deactivate the collsion pair pair_id in geomModel.collisionPairs if it exists.")
119 .def(
"deactivateAllCollisionPairs",
122 "Deactivate all collision pairs.")
123 #ifdef PINOCCHIO_WITH_HPP_FCL 124 .def(
"setSecurityMargins",
125 &GeometryData::setSecurityMargins,
126 setSecurityMargins_overload(bp::args(
"self",
"geometry_model",
"security_margin_map",
"upper"),
127 "Set the security margin of all the collision request in a row, according to the values stored in the associative map."))
128 #endif // PINOCCHIO_WITH_HPP_FCL 130 .def(bp::self == bp::self)
131 .def(bp::self != bp::self)
140 bp::class_<GeometryData>(
"GeometryData",
141 "Geometry data linked to a Geometry Model and a Data struct.",
154 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setSecurityMargins_overload,GeometryData::setSecurityMargins,2,3)
160 #endif // ifndef __pinocchio_python_geometry_data_hpp__
void deactivateAllCollisionPairs()
Deactivate all collision pairs.
Set the Python method str and repr to use the overloading operator<<.
std::vector< bool > activeCollisionPairs
Vector of collision pairs.
void def(const char *name, Func func)
void setActiveCollisionPairs(const GeometryModel &geom_model, const MatrixXb &collision_map, const bool upper=true)
Set the collision pair association from a given input array. Each entry of the input matrix defines t...
void setGeometryCollisionStatus(const GeometryModel &geom_model, const GeomIndex geom_id, bool enable_collision)
Enable or disable collision for the given geometry given by its geometry id with all the other geomet...
static ::boost::python::class_< vector_type > expose(const std::string &class_name, const std::string &doc_string="")
Add the Python method copy to allow a copy of this by calling the copy constructor.
Main pinocchio namespace.
#define EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(...)
void visit(PyClass &cl) const
void fillInnerOuterObjectMaps(const GeometryModel &geomModel)
void deactivateCollisionPair(const PairIndex pair_id)
void activateCollisionPair(const PairIndex pair_id)