DAQ: added a check to see if curp or target_pos is Nonem as they are set to None when abr crashes
This commit is contained in:
@@ -246,7 +246,11 @@ class NonStandard(object):
|
||||
else:
|
||||
speed = self.get_speed()
|
||||
curp = self.position
|
||||
timeout = self.__timeout_margin + (abs(curp - self.__target_pos) / speed)
|
||||
if curp is None or self.__target_pos is None or speed is None:
|
||||
timeout = self.__timeout_margin
|
||||
raise RuntimeWarning("can't calculate timeout, ABR may be disconnected")
|
||||
else:
|
||||
timeout = self.__timeout_margin + (abs(curp - self.__target_pos) / speed)
|
||||
return timeout
|
||||
|
||||
def wait(self):
|
||||
|
||||
Reference in New Issue
Block a user