Collision detection and collection.

Typically: "How do I... ", "How can I... " questions
Post Reply
martin
Posts: 44
Joined: 15 Mar 2016, 10:38

Collision detection and collection.

Post by martin »

Hello,

First of all, I am working on Coppelia4.4 in ubuntu 18.

I am encountering some issues trying to detect collisions between collections.
I want to detect that the foot of NAO robot is in contact with the floor. To that, I've created a non-threat script (in the "sole link pure") with two collections. One includes the different shapes of the NAO's foot and the other simply includes the floor.

Then, I thought that in a small scene like this, when running the simulation, it should always appear "a collision" (checkCollision return a 1) because, the foot, or any of their shapes, is in contact with the floor, and a collision should appear.

However, this does not happen and the return value is always 0. Would you mind to take a look and tell me what is happening? I've tested many "setups" for the collections but none of them seems to be correct.

The scene is this one:
https://www.dropbox.com/scl/fi/84jfue9h ... y5zl8&dl=0

Regards!

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

Re: Collision detection and collection.

Post by fferri »

There are two problems with your scene:

1) Floor object is not collidable
2) Error in collection creation:

Code: Select all

sim.addItemToCollection(robotCollectionR, sim.handle_tree, robotRFoot, 1)
should be:

Code: Select all

sim.addItemToCollection(robotCollectionR, sim.handle_tree, robotRFoot, 0)

martin
Posts: 44
Joined: 15 Mar 2016, 10:38

Re: Collision detection and collection.

Post by martin »

Thank you so much!

I forgot the point of making shapes collidable.

Regards!

Post Reply