Motion Planning (OMPL) mobile robot, cannot detect obstacles

Typically: "How do I... ", "How can I... " questions
Post Reply
geo3112
Posts: 5
Joined: 15 Jul 2019, 00:04

Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by geo3112 » 15 Jul 2019, 12:36

Hello,

I am using the OMPL plugin with a child script to generate a trajectory for a mobile robot. It works for linear paths with no obstacles. With obstacles present in the scene, even though I add a collision pair between a robot collection and sim.handle_all, it just go through them and does not take it into account. All obstacle have the collidable flag active and are respondable.
This the link to the scene: https://drive.google.com/open?id=1GG4xg ... W44kRkLsQs

Thank you,

Georges
Last edited by geo3112 on 15 Jul 2019, 16:18, edited 1 time in total.

fferri
Posts: 365
Joined: 09 Sep 2013, 19:28

Re: Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by fferri » 15 Jul 2019, 15:10

Collision pairs are checked with simCheckCollision. Therefore the objects need to have the collidable flag.

geo3112
Posts: 5
Joined: 15 Jul 2019, 00:04

Re: Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by geo3112 » 15 Jul 2019, 16:03

Yes the collidable flag is on, but not working ...

fferri
Posts: 365
Joined: 09 Sep 2013, 19:28

Re: Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by fferri » 15 Jul 2019, 17:37

Collision pairs passed to simOMPL.setCollisionPairs are supposed to be valid handles returned by sim.getObjectHandle or sim.getCollectionHandle, or sim.handle_all.

Why in your code you have:

Code: Select all

    collisionPairs={2000001, -2}
    ...
    if collisionPairs ~= nil then
        simOMPL.setCollisionPairs(t, collisionPairs)
    end
?

geo3112
Posts: 5
Joined: 15 Jul 2019, 00:04

Re: Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by geo3112 » 15 Jul 2019, 17:45

I had some syntax issue for some unknown reason, so I replaced the call to the getHandles by their respective values. I just tried creating the lua table with the call to the functions, nothing changed, still does not recognize any collisions.

fferri
Posts: 365
Joined: 09 Sep 2013, 19:28

Re: Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by fferri » 15 Jul 2019, 18:11

I didn't see how you replaced those values.

I recommend you having a look at scenes/motionPlanningDemo1.ttt, where collections are used:

Code: Select all

    collisionPairs={sim.getCollectionHandle('manipulator'),sim.getCollectionHandle('environment')}
Then use Tools -> Collections to define the two collections.

geo3112
Posts: 5
Joined: 15 Jul 2019, 00:04

Re: Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by geo3112 » 15 Jul 2019, 18:15

Tried defining two collections, one for the robot and one for the environment. Still no collision detection:

https://drive.google.com/open?id=1GG4xg ... W44kRkLsQs

geo3112
Posts: 5
Joined: 15 Jul 2019, 00:04

Re: Motion Planning (OMPL) mobile robot, cannot detect obstacles

Post by geo3112 » 16 Jul 2019, 00:13

Solved it. Had to put the base dummy as parent of the robot tree instead of being a child...

Post Reply