Page 1 of 1

Simulation freeze when sensor enters objects area

Posted: 08 Apr 2019, 08:52
by pps
Hello, I have remote controlled car in scene like this https://imgur.com/a/EDWYBIn, and i have a little problem.

In first simulation run, everytime when proximity sensor enters tree object area (like on mentioned picture), simulation freezes for a short period of time. Time period depends on size of tree model. This is happeneging in first lap (scene is racing circuit) only. When car is on 2nd lap and sensors enters tree area, there is no freeze at all. Even if i stop simulation and run it again, freeze occures only on that tree model, which wasnt "loaded by sensors" before.

Isn't it bit strange? Is there a way how to fix it?

Thanks.

Re: Simulation freeze when sensor enters objects area

Posted: 09 Apr 2019, 08:06
by coppelia
Hello,

this is because V-REP will compute calculation structures on-the-fly, when needed. Those calculation structures are needed in order to make fast collision, distance or proximity sensor calculations.
So as long as the proximity sensor's bounding box doesn't overlap with the shape's bounding box, nothing will happen. But the first time it overlaps, the calculation structure is computed for the shape (this takes some time). That calculation structure is quite large, and not saved in a scene save operation (but you can modify that behaviour via the environment dialog). Another option to avoid those temporary freezes, would be to force calculation of those structures at the very beginning of a simulation, e.g. by moving and checking a proximity sensor over a shape.

Cheers

Re: Simulation freeze when sensor enters objects area

Posted: 10 Apr 2019, 08:54
by pps
Hey,

thanks for reply. Changing environment setting solved my problem.