Why the simulation time goes very slowly?

Typically: "How do I... ", "How can I... " questions
wode
Posts: 18
Joined: 12 Oct 2019, 03:47

Why the simulation time goes very slowly?

Hello，
I set the simulation parameters as the default values ：Bullet2.7， Accurate(default)， dt=50ms(default).
However, when i start the simulation, the simulation time goes very slowly. Simulation time add 50ms takes about 3 seconds of the real time. And this cause that the simulation looks very slow.

The configuration of my computer is CPU: intel i7-9700k , GPU: RTX 2070 with enough 16GB RAM, and i try to simulation my project in a server with 2*RTX6000 and Intel Xeon Silver 4210.
However, the simulation time also goes very slowly.

So why my simulation time goes so slowly and how to fix the problem?

Sinserely

wode
Posts: 18
Joined: 12 Oct 2019, 03:47

Re: Why the simulation time goes very slowly?

Anyone can help me?
Thanks

coppelia
Posts: 8125
Joined: 14 Dec 2012, 00:25

Re: Why the simulation time goes very slowly?

Hello,

simulation time depends on various factors. As you mentioned it it will also depend on the hardware you are using. But often more importantly is the type of simulation (i.e. simulation content) and functionality you are using. So maybe you can post the scene that is problematic?
Is it possible that the shapes are very heavy (i.e. lots of vertices/triangles)?

Cheers

wode
Posts: 18
Joined: 12 Oct 2019, 03:47

Re: Why the simulation time goes very slowly?

Thank you!

I use vrep to simulate the UAVs control and there are about 200 quadricopters in my scene.
The most used functions in my scene are get/setObjectPosition, readVisionSensor and so on.
Besides, I use matlab to compute the UAV control algorithm and send the UAVs' velocities to vrep. Then vrep feedback the positions and other information to matlab.

And my question are :
1. Which takes more simulation time ? The communication between vrep and matlab or the vrep simulation process?
2.How to speed up the simulation time ?
3. I use the video record of vrep and find the time in video record is real time, but the simulation time is much longer than record time. Why?

coppelia
Posts: 8125
Joined: 14 Dec 2012, 00:25

Re: Why the simulation time goes very slowly?

2. You first need to analyze where the bottleneck is. My guess is that you have many vision sensors that require quite some time. So you could e.g. instead of handling vision sensors in each simulation step, do it in every 5th simulation step for instance. You can easily achieve this by flagging a vision sensor as explicit handling and calling sim.handleVisionSensor on it every 5th simulation step.