I did a simulation of a robot with hinges and motors for articulations, and it seems like it's not really deterministic. But I would like to use my results on a real robot so I want it to be deterministic.
My robot is about 3cm long so I scaled the world by a 100 factor (just by scaling the gravity by 100, do I need to do something else ?)
I call stepSimulation like this :
Code: Select all
world->stepSimulation(1.f/240.f);
But if I run my simulation 15 times and display the position of the robots, it's not always the same results :
X Y Z
-0.353351 -19.6386 2.0749
-1.88595 -20.2211 2.16615
2.30163 -22.2516 2.25783
-1.36052 -20.7487 2.16961
2.93604 -20.4361 2.1884
-1.22291 -20.9594 2.18444
-1.88595 -20.2211 2.16615
1.02449 -22.7842 2.0988
-1.36052 -20.7487 2.16961
0.655865 -23.8902 2.2304
11.7345 -24.4347 2.24751
-0.353351 -19.6386 2.0749
1.26487 -22.0329 2.18892
39.6191 22.1354 6.25826
-0.353351 -19.6386 2.0749
Do you have any advice in order to make it deterministic ? Sometimes I have the same results (like the first line and the last one, or the second one and the 7th one), it's weird isn't it ?