diff --git a/rb_ws/src/buggy/scripts/watchdog/watchdog.py b/rb_ws/src/buggy/scripts/watchdog/watchdog.py index ca9468c..eff5522 100755 --- a/rb_ws/src/buggy/scripts/watchdog/watchdog.py +++ b/rb_ws/src/buggy/scripts/watchdog/watchdog.py @@ -57,13 +57,15 @@ def check_stepper_steering(self, msg): if self.alarm < 2: self.alarm = 0 - # Finds the minimum difference between the stepper's reported angle and the last 10 steering instructions - steer_instruct_diff_min = min( - map( - lambda steer: abs(stepper_steer - steer), - self.steering_instructions + steer_instruct_diff_min = 0 + if len(self.steering_instructions) > 0: + # Finds the minimum difference between the stepper's reported angle and the last 10 steering instructions + steer_instruct_diff_min = min( + map( + lambda steer: abs(stepper_steer - steer), + self.steering_instructions + ) ) - ) if steer_instruct_diff_min > Watchdog.STEERING_DEVIANCE: if self.inAutonSteer: