Skip to content

Commit dc91c1c

Browse files
gregcowelldwalton76
authored andcommitted
Fix steering bug (#394)
1 parent e42f4c0 commit dc91c1c

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
@@ -1549,9 +1549,9 @@ def on_for_rotations(self, left_speed_pct, right_speed_pct, rotations, brake=Tru
15491549

15501550
if left_speed > right_speed:
15511551
left_rotations = rotations
1552-
right_rotations = float(right_speed / left_speed) * rotations
1552+
right_rotations = abs(float(right_speed / left_speed)) * rotations
15531553
else:
1554-
left_rotations = float(left_speed / right_speed) * rotations
1554+
left_rotations = abs(float(left_speed / right_speed)) * rotations
15551555
right_rotations = rotations
15561556

15571557
# Set all parameters

0 commit comments

Comments
 (0)