Control laser sensor with threaded script

Typically: "How do I... ", "How can I... " questions
Post Reply
Posts: 1
Joined: 12 Dec 2017, 10:25

Control laser sensor with threaded script

Post by zhangtengyu » 13 Dec 2017, 08:33

Dear coppelia:
I want to simulate several Pioneer-p3dx with laser sensor in a scene, but the simulation becomes very slow because
of too many laser sensors. I want to know if there is a way to control laser sensor in threaded script to improve some efficiency.
Thank you

Site Admin
Posts: 6266
Joined: 14 Dec 2012, 00:25

Re: Control laser sensor with threaded script

Post by coppelia » 17 Dec 2017, 17:55

Hello Tengyu,

the best to do is to flag each of the proximity sensors as explicit handling. This way, you are in control when the proximity sensors are handled (by default, with implicit handling, each proximity sensor is handled every 50ms simulation time).

Then you can check the simulation time, and if, for example, 500ms passed since last time the sensors were handled, you handle them again (i.e. with simHandleProximitySensor). This way you are basically reducing the handling frequency.


Post Reply