File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -246,13 +246,16 @@ def start_robot(self):
246246 time .sleep (1 )
247247
248248 robot_mode = self .get_robot_mode ()
249- self ._check_call (robot_mode )
250- if robot_mode .robot_mode .mode != RobotMode .RUNNING :
251- raise Exception (
252- f"Incorrect robot mode: Expected { RobotMode .RUNNING } , got { robot_mode .robot_mode .mode } "
253- )
254-
255- self ._check_call (self .stop ())
249+ start_time = time .time ()
250+ while time .time () - start_time < 10 :
251+ self ._check_call (robot_mode )
252+ if robot_mode .robot_mode .mode == RobotMode .RUNNING :
253+ self ._check_call (self .stop ())
254+ return
255+ time .sleep (0.1 )
256+ raise Exception (
257+ f"Incorrect robot mode: Expected { RobotMode .RUNNING } , got { robot_mode .robot_mode .mode } "
258+ )
256259
257260 def _check_call (self , result ):
258261 if not result .success :
You can’t perform that action at this time.
0 commit comments