diff --git a/control/walle.py b/control/walle.py index 56ecf38..63a139e 100644 --- a/control/walle.py +++ b/control/walle.py @@ -48,10 +48,10 @@ class WallE: velocity_r = sin_angle * force velocity_l = cos_angle * force elif cos_angle < 0 and sin_angle > 0: - if cos_angle < sin_angle: + if abs(cos_angle) < sin_angle: velocity_r = 1 - sin_angle * force velocity_l = sin_angle * force - elif cos_angle > abs(sin_angle): + elif cos_angle > sin_angle: velocity_r = sin_angle * force velocity_l = cos_angle * force else: