From ca9e7ff70070c3499e0ec3aa125370655e31067d Mon Sep 17 00:00:00 2001 From: Edvin Date: Fri, 16 May 2025 16:01:42 +0200 Subject: Working on goal pairing and fully autonomous drive --- bt.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'bt.py') diff --git a/bt.py b/bt.py index bafa5f2..4142669 100755 --- a/bt.py +++ b/bt.py @@ -26,13 +26,26 @@ while read != "1000": read = read.decode("utf-8").strip('\n') print(f"{read}") - sleep(1) + if "98" in read: + while read == "98": + read = sys.stdin.readline().strip('\n') + print(f"{read}") + with open("position.txt", "r") as f: + for line in f: + line = line.strip("\n") + x, y = line.split(",") + x = int(x) + y = int(y) + recv_sock.send(f"98, {x}, {y}\n".encode()) + # message = message + f"{x}, {y}, " + f.close() + read = "99" + else: + sleep(0.5) # Acknowledge ÖS command recv_sock.send(f"{read}, ".encode()) # Remember NEW LINE for ÖS to be able to read lines. - # TODO Maybe obstruction ack can be sent here? - # Send DWM data if read == "10": sleep(1) -- cgit v1.2.3