diff --git a/alrys/test.py b/alrys/test.py index fd73c69..0557ae4 100644 --- a/alrys/test.py +++ b/alrys/test.py @@ -24,11 +24,11 @@ for e in buffer.split(): position = [47.5, 43.5, 0] -index = 2 +index = 6 def mon_itineraire(): global steps, position, index - x, a, y, b = steps[(index - 1) * 4:index * 4] + x, a, y, b = steps[index:index + 4] x += a * 1e-14 y += b * 1e-14 a = atan2(y - position[1], x - position[0]) * 180.0 / pi - position[2] @@ -38,7 +38,7 @@ def mon_itineraire(): position[2] += a position[0] += l * cos(position[2] * pi / 180.0) position[1] += l * sin(position[2] * pi / 180.0) - index += 1 - return len(steps) >= index * 4 + index += 4 + return index < len(steps) - 3 print(aller_selon(mon_itineraire))