MoveIt collision checking: when is contact stored vs. not stored [closed]
(ROS version is Melodic)
I'm using PlanningScene::checkCollision()
to check for collisions, and noticed that when there are multiple collisions -- as in more than 1 pair of colliding objects -- not all contacts are stored in CollisionResult.contacts
(struct reference).
I see log messages like (note the not stored
in the third log message):
Found 1 contacts between 'object_0' (type 'Object') and 'link_1' (type 'Robot link'), which constitute a collision. 1 contacts will be stored
Collision checking is considered complete (collision was found and 1 contacts are stored)
Found a contact between 'object_5' (type 'Object') and 'link_7' (type 'Robot link'), which constitutes a collision. Contact information is not stored.
Collision checking is considered complete (collision was found and 1 contacts are stored)
What actually determines which contacts get stored and which ones don't?
When I unpack CollisionResult.contacts
, it only has information on the contact that was stored and is missing the one that wasn't stored (which is in agreement with the logs). checkCollision()
has a few overloads and the one I call is:
PlanningScene::checkCollision(const collision_detection::CollisionRequest& req, collision_detection::CollisionResult& res, const robot_state::RobotState& robot_state)
CollisionRequest
's contacts
, distance
, cost
, and verbose
are all set to true
.
For my use-case I need all contacts because I'm reasoning a bunch of stuff off of that.