Page 1 of 1

Velocity resolution at small time steps

Posted: 02 Nov 2016, 21:14
by Wilsonator
I will start this off by saying that I am not sure how deep this request goes, and may be more of a long time goal.

I have noticed that when using a small time step (0.2ms) begins to show some resolution limits for linear velocity of object, especially as they deviate further from the global origin. From this I can only assume that this is a limitation of using float precision to store object position. As the object gets further away from the origin, less digits are available to represent number to the right of the decimal point, and especially when using small time step we end up with low resolution for calculating velocity (and acceleration).

Specifically I have noticed this issue when using data stream recording on graphs (Object: absolute 'x/y/z'-velocity) and also when using API functions like vrep.simxGetObjectVelocity().

To give an idea of the limitation I am seeing the following are the resolution limits I have noticed (behavior was the same for all simulators - tested Vortex, Bullet 2.78, ODE, Newton):
@0.0002s time step (0.2ms) - at position (x,y,z) of approximately (50,0,0)
x-Velocity resolution - ~0.02 m/s
z-Velocity resolution - ~0.000075 m/s
x-Acceleration resolution - ~95 m/s^2
z-Acceleration resolution - ~0.75 m/s^2

@0.0002s time step (0.2ms) - at position (x,y,z) of approximately (500,0,0)
x-Velocity resolution - ~0.15 m/s
z-Velocity resolution - ~0.000075 m/s
x-Acceleration resolution - ~760 m/s^2
z-Acceleration resolution - ~0.75 m/s^2

As can be seen, at both 50 and 500 meters the resolution of the x-velocity and x-acceleration have become a problem. Now since I saw identical resolution limits for all the simulators, this makes me think that these velocity and acceleration representations are not returned directly from the physics engines, but instead calculated after the physics engine step by taking the derivative of the positions (of course I may be wrong on that!), which might make fixing this easier. Otherwise I am guessing that the only solution would be compiling the physics simulators for double precision.

Is there any way you can fix this resolution limitation for velocity and acceleration outputs?

Re: Velocity resolution at small time steps

Posted: 03 Nov 2016, 10:40
by coppelia
Hello,

yes, you are right, limits of using single precision floats show at larger distances from the origin (among others). The switch to double precision is already on our roadmap ;)

Cheers