diff options
| author | Edvin <[email protected]> | 2025-05-05 13:40:51 +0200 |
|---|---|---|
| committer | Edvin <[email protected]> | 2025-05-05 13:40:51 +0200 |
| commit | aec35efd86fc121c7e4105664f798e0158ca91c1 (patch) | |
| tree | 73c539f7aaf8afde8ca3a041b5c744061c138db7 /bt.py | |
| parent | 94203da32939e02476e2c747718e1d5d4eeb238a (diff) | |
Added 45 degree turn
Diffstat (limited to 'bt.py')
| -rwxr-xr-x | bt.py | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -26,7 +26,9 @@ while read != "1000": read = read.decode("utf-8").strip('\n') print(f"{read}\r") - message = "" + sleep(1) + + print("0\r") # print(f"Sending: 'Acknowledge: {read}'") # Acknowledge ÖS command @@ -38,15 +40,21 @@ while read != "1000": for line in f: line = line.strip("\n") x, y, z, qf = line.split(",") - x = float(x) * 1000 - y = float(y) * 1000 + x = int(float(x) * 1000) + y = int(float(y) * 1000) print(f"x: {x}, y: {y}") recv_sock.send(f"{x}, {y}, ".encode()) # message = message + f"{x}, {y}, " f.close() # Send angle data - recv_sock.send("0, ".encode()) + with open("angle.txt", "r") as f: + for line in f: + angle = line.strip("\n") + print(angle) + recv_sock.send(f"{angle}, ".encode()) + + recv_sock.send("0, ".encode()) # Near goal # message = message + "0, " # Send LIDAR data |
