← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/bt.py
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-05-05 13:40:51 +0200
committerEdvin <[email protected]>2025-05-05 13:40:51 +0200
commitaec35efd86fc121c7e4105664f798e0158ca91c1 (patch)
tree73c539f7aaf8afde8ca3a041b5c744061c138db7 /bt.py
parent94203da32939e02476e2c747718e1d5d4eeb238a (diff)
Added 45 degree turn
Diffstat (limited to 'bt.py')
-rwxr-xr-xbt.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/bt.py b/bt.py
index 23ed7b2..9d7c70f 100755
--- a/bt.py
+++ b/bt.py
@@ -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