diff --git a/python/test.py b/python/test.py index ae5a23d..0ff701f 100644 --- a/python/test.py +++ b/python/test.py @@ -109,6 +109,30 @@ def compass(controller: Controller): pass +def route(controller: Controller): + print("Route") + controller.set_direction(OutAngle.Left) + controller.set_gps(True) + controller.set_speed(50, 50) + controller.set_distance(1.2, Unit.Kilometres) + sleep(1) + controller.set_distance(1.1, Unit.Kilometres) + sleep(1) + controller.set_distance(1, Unit.Kilometres) + sleep(1) + remaining = 900 + while remaining > 0: + controller.set_distance(remaining, Unit.Metres) + sleep(1) + remaining -= 100 + controller.set_direction(OutAngle.Right, OutType.Flag) + remaining = 900 + while remaining > 0: + controller.set_distance(remaining, Unit.Metres) + sleep(1) + remaining -= 100 + + if __name__ == '__main__': import os name = '/dev/rfcomm0' if os.name != 'nt' else 'COM8'