Webots programming with Python - blocking code
I tried robot.step() and it works thank you. I use small increments of time so that the code is not continuously blocing and there is time for my sensors to do the reading.
I am using webots for my project at university. I want my robot to do a specific action for a certain amount of time, but I cannot find a way to do it without blocking the code and the sensors and consequently the whole simulation. I tried both the commands robot.step() and time.sleep() but they both blocck the code and by the time the action is finished the robot does not do anything else even when it is normally supposed to. Specificaly I want the robot to go backwards for a certain ammount of time if the sesnsors at the front and the sides read below a specific distance. Any ideas on how to do it without blocking the code? because if for example I use one of the above commands and there is an object behind the robot the beck sensor will not work because it is blocked and the robot will hit on the object. Thank you.