Skip to content

Commit

Permalink
Ensure no warnings when nothing has been reported
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceMcRooster committed Nov 13, 2024
1 parent a58ac13 commit 18e200d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions rb_ws/src/buggy/scripts/watchdog/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 18e200d

Please sign in to comment.