pifej / RobotSoccer

Simulating Robots playing soccer using MatLab
2 stars 2 forks source link

Ball sliding #13

Closed Marteen21 closed 7 years ago

Marteen21 commented 8 years ago

Sometimes the ball slides around the robot

pifej commented 8 years ago

It depends on the SampleTime. For example if the SampleTime is 0.1, 0.09, 0.099, 0.0999 you get 4 different matches. SampleTime = 0.09999 will be very similar to SampleTime = 0.1.

pifej commented 7 years ago

When the Simulatoin.CollisionTime is very small (<0.0001) the collisionHappen can't be true because of the parametersof the "if" in SimState.m

for j = 1 : length(bcTimes)
                if(~isnan(bcTimes(j)) && nextCollisionTime > bcTimes(j) && bcTimes(j)>0.0001)
                    nextCollisionTime = bcTimes(j);                                             
                    collisionHappened = true;
                end
            end

If it can be very small the whole program stuck in a "CollisoinHappened loop" (see LogFile.txt) LogFile.txt