OMPL collision detection/avoidance vs bounding box

Typically: "How do I... ", "How can I... " questions
Post Reply
pwyq
Posts: 12
Joined: 28 May 2021, 19:30

OMPL collision detection/avoidance vs bounding box

Post by pwyq »

Hi Coppelia,

I'm trying to use OMPL to generate a collision-free path between configurations. I also use sim.checkCollision() to check if there is any collisions.

In this screenshot: https://ibb.co/bH39xV6, I think the arm only collides with the bounding box of the obstacle but not the actual obstacle, but CoppeliaSim reports a collision as shown in the dialog.

My questions:
1. Does sim.checkCollision() check against the bounding box of objects or the actual shape of objects? If it's checking against the bounding box, can I make the bounding box the same size as the object?
2. (Side question) Does OMPL traditional path planning algorithm (e.g. LazyPRM*) guarantee the solution path are always collision-free?

Thank you in advance!

pwyq
Posts: 12
Joined: 28 May 2021, 19:30

Re: OMPL collision detection/avoidance vs bounding box

Post by pwyq »

On a side note, is there a way to add a 'safe distance' between manipulator and obstacles? For instance, let the OMPL solution path always be x meters away from the obstacles.

coppelia
Site Admin
Posts: 8987
Joined: 14 Dec 2012, 00:25

Re: OMPL collision detection/avoidance vs bounding box

Post by coppelia »

Hello,

about your questions:
  • sim.checkCollision checks for intersections between the triangular meshes. Bounding boxes are only used to speed-up calculations (and other OBB-tree calculation structures are also used to that end). So my guess is that your robot arm contains some invisible shapes that collide. The other possibility is that since collision, the arm or cuboid has moves. A simple way to test that would be to copy both in the colliding state, paste them into a new scene and in the Lua commander, manually call sim.checkCollision.
  • Well, there are many conditions. OMPL will guarantee that the calculated states are respecting certain conditions (in your case, that no collision happens). Keep in mind that OMPL and in general randomized path planners are sampling the search space randomly, while trying to connect collision-free states that are close enough. Have also a look at simOMPL.setStateValidityCheckingResolution. See the demo scene scenes/pathPlanning/state_validity_checking_resolution.ttt
  • Yes, you can check the validity of a state that OMPL randomly samples by using a state validation callback: simOMPL.setStateValidationCallback. In that callback function, you can check for a minimum distance between your robot and the environment for instance. See the demo scene scenes/pathPlanning/state_validation_callback.ttt
Cheers

Post Reply