From c6b33683b73512df677585c74e4a5af12c10d041 Mon Sep 17 00:00:00 2001 From: Rick Rongen Date: Mon, 18 May 2020 20:11:46 +0200 Subject: [PATCH] feat: fixed logic of drive --- control/walle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: