I can't get the same result.

Post Reply
yamadagenki
Posts: 4
Joined: Tue Jan 03, 2012 11:57 am

I can't get the same result.

Post by yamadagenki »

I am a beginner of Bullet Physics, but I have a question about its performance.

I am simulating quadruped robot in Bullet Physics world.

I set some parameters(constant) to let the robot move, and record the distance(>0) which the robot move in 3 seconds.

But the result(motion) is not same at each times. I think all parameters I set are constant, so the robot will conduct the same behavior and we will get the same result.

I have no idea about the problem.

Please tell me why the result is different.

(Sorry I am a Japanese student... poor English...)

http://www.youtube.com/watch?v=0cIuZh3E2v8
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: I can't get the same result.

Post by MaxDZ8 »

I've only had minor experience with complex constraints but I've never observed anything so extreme.
How is your world stepping?
Try running everything at constant step.
In my experience, Bullet has very good repeatibility.
yamadagenki
Posts: 4
Joined: Tue Jan 03, 2012 11:57 am

Re: I can't get the same result.

Post by yamadagenki »

stepSimulation Time is set to be 1/100.

However, it doesn't return the same motion.
I have no idea.

Though I can get really same results with toy problems, I can't get the same results with complicate simulation...
CireNeikual
Posts: 19
Joined: Thu Jun 28, 2012 5:06 pm

Re: I can't get the same result.

Post by CireNeikual »

Try destroying the physics world and re-creating it every epoch. This shouldn't be necessary, but perhaps it will let you run the simulation reliably.
hiker
Posts: 83
Joined: Tue Oct 24, 2006 11:52 pm
Location: Australia
Contact:

Re: I can't get the same result.

Post by hiker »

yamadagenki wrote:Though I can get really same results with toy problems, I can't get the same results with complicate simulation...
In SuperTuxKart we actually reset the variable m_localTime of btDiscreteDynamicsWorld to 0 if we replay a race. Otherwise this variable will have some 'left over' time:

Code: Select all

                m_localTime += timeStep;
                if (m_localTime >= fixedTimeStep)
                {
                        numSimulationSubSteps = int( m_localTime / fixedTimeStep);
                        m_localTime -= numSimulationSubSteps * fixedTimeStep;
                }
Once we reset this to 0 when we replay a race, we have (I think) identical results for one replay now, but still not the same results as the first time when the replay was recorded. My suspicion is that this difference is caused by FP errors (we write out time step size and user input as ascii to a file, which we then read to replay a race, so there might be some difference in the conversion). Recreating the world would have the same effect, but this should be less work.

Hope that helps!
Joerg
Post Reply