I am using while loop in order to do a function for a specific ammount of time. I use Webots and I use the getTime() function to get the simulation clock time. The problem is that the program does not go into the loop function at all and when I revert it it crashes. the while loop is as follows:
tim=float(robot.getTime())
tim2=float(robot.getTime())
while tim2-tim<0.581:
right(5.211,5.211)
tim2=float(robot.getTime())
Can someone help me understand why it doesnt work?