Skip to content

Commit aab7a1c

Browse files
gregcowelldwalton76
authored andcommitted
Fix steering bug (#394)
1 parent 5e33dff commit aab7a1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ev3dev/motor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,9 +1538,9 @@ def on_for_rotations(self, left_speed_pct, right_speed_pct, rotations, brake=Tru
15381538

15391539
if left_speed > right_speed:
15401540
left_rotations = rotations
1541-
right_rotations = float(right_speed / left_speed) * rotations
1541+
right_rotations = abs(float(right_speed / left_speed)) * rotations
15421542
else:
1543-
left_rotations = float(left_speed / right_speed) * rotations
1543+
left_rotations = abs(float(left_speed / right_speed)) * rotations
15441544
right_rotations = rotations
15451545

15461546
# Set all parameters

0 commit comments

Comments
 (0)