From 1af9ed3c95f30cadf11162b1dea4517f687fe50c Mon Sep 17 00:00:00 2001 From: LeProblemeEDMN <72100759+LeProblemeEDMN@users.noreply.github.com> Date: Sat, 1 Jun 2024 23:06:15 +0000 Subject: [PATCH] Update wheeledbase.py --- raspberrypi/daughter_cards/wheeledbase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/raspberrypi/daughter_cards/wheeledbase.py b/raspberrypi/daughter_cards/wheeledbase.py index dd989be..30f4955 100644 --- a/raspberrypi/daughter_cards/wheeledbase.py +++ b/raspberrypi/daughter_cards/wheeledbase.py @@ -347,13 +347,15 @@ def goto_stop(self, x, y,sensors, theta=None, direction=None, finalangle=None, l rPos=self.get_position() radiusRobot=370 ang=rPos[2]%(2*math.pi) - print(ang,theta) + #fait en sorte que |ang-theta|math.pi): theta-=2*math.pi if(ang-theta>math.pi): ang-=2*math.pi + print(ang,theta) trigo=theta>ang#va ds le sens trigo + print(trigo) #le rbot va bouger ds l'intervalle [a;b] inclus ds [-pi;2pi] a=min(ang,theta) b=max(ang,theta)