Page 1 of 1

Collision detection and collection.

Posted: 20 Feb 2024, 14:06
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!

Re: Collision detection and collection.

Posted: 20 Feb 2024, 14:19
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)

Re: Collision detection and collection.

Posted: 20 Feb 2024, 15:47
by martin
Thank you so much!

I forgot the point of making shapes collidable.

Regards!