41namespace bind_collision_detection
46 const std::string& name2)
50 bool collision_allowed = acm.
getEntry(name1, name2, type);
62 type_str =
"CONDITIONAL";
70 std::pair<bool, std::string> result = std::make_pair(collision_allowed, type_str);
78 py::class_<collision_detection::AllowedCollisionMatrix, std::shared_ptr<collision_detection::AllowedCollisionMatrix>>(
81 Definition of a structure for the allowed collision matrix. All elements in the collision world are referred to by their names. This class represents which collisions are allowed to happen and which are not.
83 .def(py::init<std::vector<std::string>&, bool>(),
85 Initialize the allowed collision matrix using a list of names of collision objects.
88 names (list of str): A list of names of the objects in the collision world (corresponding to object IDs in the collision world).
89 allowed (bool): If false, indicates that collisions between all elements must be checked for and no collisions will be ignored.
91 py::arg("names"), py::arg(
"default_entry") =
false)
95 Get the allowed collision entry for a pair of objects.
98 name1 (str): The name of the first object.
99 name2 (str): The name of the second object.
102 (bool, str): Whether the collision is allowed and the type of allowed collision.
104 py::arg("name1"), py::arg(
"name2"))
107 py::overload_cast<const std::string&, const std::string&, bool>(
109 py::arg(
"name1"), py::arg(
"name2"), py::arg(
"allowed"),
111 Set the allowed collision state between two objects.
114 name1 (str): The name of the first object.
115 name2 (str): The name of the second object.
116 allowed (bool): If true, indicates that the collision between the two objects is allowed. If false, indicates that the collision between the two objects is not allowed.
120 py::overload_cast<const std::string&, const std::string&>(
122 py::arg(
"name1"), py::arg(
"name2"),
124 Remove an entry corresponding to a pair of elements. Nothing happens if the pair does not exist in the collision matrix.
127 name1 (str): The name of the first object.
128 name2 (str): The name of the second object.
Definition of a structure for the allowed collision matrix. All elements in the collision world are r...
void clear()
Clear the allowed collision matrix.
void setEntry(const std::string &name1, const std::string &name2, bool allowed)
Set an entry corresponding to a pair of elements.
bool getEntry(const std::string &name1, const std::string &name2, AllowedCollision::Type &allowed_collision_type) const
Get the type of the allowed collision between two elements. Return true if the entry is included in t...
void removeEntry(const std::string &name1, const std::string &name2)
Remove an entry corresponding to a pair of elements. Nothing happens if the pair does not exist in th...
@ CONDITIONAL
The collision is allowed depending on a predicate evaluated on the produced contact....
@ NEVER
Collisions between the pair of bodies is never ok, i.e., if two bodies are in contact in a particular...
@ ALWAYS
Collisions between a particular pair of bodies does not imply that the robot configuration is in coll...
void initAcm(py::module &m)
std::pair< bool, std::string > getEntry(const collision_detection::AllowedCollisionMatrix &acm, const std::string &name1, const std::string &name2)