ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

MoveIt collision checking: when is contact stored vs. not stored [closed]

asked 2021-10-21 12:03:13 -0500

abhishek47 gravatar image

(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.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by abhishek47
close date 2021-10-29 07:18:29.582537

1 Answer

Sort by ยป oldest newest most voted

answered 2021-10-28 00:42:30 -0500

abhishek47 gravatar image

(Posted this on MoveIt discord where I got the answer. Turned out to be a case of RTFM)

CollisionRequest (struct reference) has a field max_contacts -- Overall maximum number of contacts to compute -- whose default value is 1 (constructor list).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-10-21 12:03:13 -0500

Seen: 186 times

Last updated: Oct 28 '21