Commit c9227ee8 by Oleksandr Barabash

minor fixes

parent b155108e
...@@ -1041,15 +1041,22 @@ def run_receiver(receivers): ...@@ -1041,15 +1041,22 @@ def run_receiver(receivers):
for rx in receivers: for rx in receivers:
try: try:
if rx.isActive: if rx.isActive:
# This is very bad part of the code
# We have to change this to the queue for each receiver.
rx.update() rx.update()
except IOError: except IOError:
print("Problem connecting to receiver.") print("Problem connecting to receiver.")
rx.d_2_last_intersection = [] rx.d_2_last_intersection = []
time.sleep(0.1) time.sleep(0.1)
for x in range(len(receivers)):
for y in range(x): # for x in range(len(receivers)):
if x != y: # for y in range(x):
# if x != y:
receivers_len = len(receivers)
for x in range(receivers_len):
y_receiver_id = x + 1
for y in range(y_receiver_id, receivers_len):
if (receivers[x].confidence >= ms.min_conf and if (receivers[x].confidence >= ms.min_conf and
receivers[y].confidence >= ms.min_conf and receivers[y].confidence >= ms.min_conf and
receivers[x].power >= ms.min_power and receivers[x].power >= ms.min_power and
...@@ -1076,12 +1083,12 @@ def run_receiver(receivers): ...@@ -1076,12 +1083,12 @@ def run_receiver(receivers):
# or not. But if it is, you better fucking sleep # or not. But if it is, you better fucking sleep
# 10ms after each cycle to prevent 100% load # 10ms after each cycle to prevent 100% load
# of the CPU. # of the CPU.
time.sleep(0.1) time.sleep(0.001)
# 11.01.2023::s1z: I don't know if this shit-code is blocking # 11.01.2023::s1z: I don't know if this shit-code is blocking
# or not. But if it is, you better fucking sleep # or not. But if it is, you better fucking sleep
# 10ms after each cycle to prevent 100% load # 10ms after each cycle to prevent 100% load
# of the CPU. # of the CPU.
time.sleep(0.1) time.sleep(0.001)
if intersect_list.size != 0: if intersect_list.size != 0:
avg_coord = np.average( avg_coord = np.average(
...@@ -1151,7 +1158,7 @@ def run_receiver(receivers): ...@@ -1151,7 +1158,7 @@ def run_receiver(receivers):
# or not. But if it is, you better fucking sleep # or not. But if it is, you better fucking sleep
# 10ms after each cycle to prevent 100% load # 10ms after each cycle to prevent 100% load
# of the CPU. # of the CPU.
time.sleep(0.01) # 11.01.2023::s1z: The fuck is this crap ? time.sleep(0.001) # 11.01.2023::s1z: The fuck is this crap ?
DATABASE_EDIT_Q.put(("done", None, False)) DATABASE_EDIT_Q.put(("done", None, False))
# try: # try:
...@@ -1160,7 +1167,7 @@ def run_receiver(receivers): ...@@ -1160,7 +1167,7 @@ def run_receiver(receivers):
# print("Problem connecting to receiver.") # print("Problem connecting to receiver.")
ms.rx_busy = False ms.rx_busy = False
time.sleep(1) time.sleep(0.001)
if dots > 5: if dots > 5:
dots = 1 dots = 1
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment