Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webots - Avoid "joint" objects getting inside one another (i.e. how to enable collision for objects in hinge joint?)

I have a hinge joint between two objects, a sphere and a box. I wonder how I can avoid the sphere going inside the box when it's rotating around the box with a rotational motor. enter image description here

Here is a snapshot of the sphere getting inside the box when rotating along x-axis: enter image description here

Both objects have physics, and are under a robot. I'm happy to share more code, but I believe it's simplistic webots world - please let me know. Thanks!

like image 413
Sanjay Verma Avatar asked Nov 27 '25 03:11

Sanjay Verma


1 Answers

You are probably looking for the 'selfCollision' field of the Robot device (which is False by default) if you set this field to True the robot will be able to self-collide.

But be careful as stated in the doc this has an impact on the simulation speed:

Enabling self collision is, however, likely to decrease the simulation speed, as more collisions will be generated during the simulation

And will not handle collision between directly consecutive solids:

Note that only collisions between non-consecutive solids will be detected. For consecutive solids, e.g., two solids attached to each other with a joint, no collision detection is performed, even if the self collision is enabled. The reason is that this type of collision detection is usually not wanted by the user, because a very accurate design of the bounding objects of the solids would be required. To prevent two consecutive solid nodes from penetrating each other, the minStop and maxStop fields of the corresponding joint node should be adjusted accordingly

More information available in the documentation: https://cyberbotics.com/doc/reference/robot#field-summary

like image 112
David Mansolino Avatar answered Nov 28 '25 21:11

David Mansolino