webots icon indicating copy to clipboard operation
webots copied to clipboard

Occuppied or empty

Open abzzall opened this issue 2 years ago • 3 comments

How can I check if position (x, y, z) is occupied or empty in webots?

abzzall avatar Aug 27 '23 03:08 abzzall

I'm not sure if it's the best way to do it, but you can place a little sphere where your need to check for occupation, and make it a TouchSensor (a bumper). When it will be in a part, it will trigger ON. However it work only with bounding object, AFAIK, so that might not be the most efficient way to do it. Moreover if you need to check multiple places at once, having many Sensor could cause performance issue, idk...

ShuffleWire avatar Sep 07 '23 08:09 ShuffleWire

I have imported OSM map with the importer and it imported buildings as the SimpleBuilding object. Also, if I place the little sphere in this SimpleBuilding object it does not detect it. Even if I try to set the lidar sensor it detects only from outside. From inside it does not detect SimpleBuilding object even if the rays of the lidar intersects the corners of the SimpleBuildings. Also, I have tried to place a big sphere and added a touch sensor, it detects the SimpleBuilding object only when the center of this sphere is outside.

abzzall avatar Sep 07 '23 16:09 abzzall

Could you please share a world with one sphere (the size you like), plus only one SimpleBuilding (not a full OSM map), that show the behavior you describe.

Also Touch sensor can be a bit tricky to use, depending on the Shape of the bounding object...

I don't understand why you speak about Lidar. Could you elaborate ?

ShuffleWire avatar Sep 08 '23 07:09 ShuffleWire