dockerfile ready

This commit is contained in:
Tomás L 2024-07-25 18:17:36 -04:00
parent 913af71226
commit 993385f809
4 changed files with 12 additions and 8 deletions

View File

@ -58,9 +58,9 @@ class URModbusServer:
Connects with the Modbus server to requests the angles of each joint, in radians
:return: Readable angle values of each joint in radials
"""
if tries>10:
print("[Angles] Modbus Error: Failed")
return 0, 0, 0, 0, 0, 0
if tries>50:
raise Exception("[Angles] Modbus Error: Failed")
#return 0, 0, 0, 0, 0, 0
packet = self.modbusTCP.read_holding_registers(270, quantity=6)
time.sleep(0.001)
@ -89,9 +89,9 @@ class URModbusServer:
Connects with the Modbus server to requests the speed of each joint, in radians per second
:return: Readable angle speeds of each joint in radians per second
"""
if tries>10:
if tries>50:
print("[Speeds] Modbus Error: Failed")
return 0, 0, 0, 0, 0, 0
#raise Exception("[Speeds] Modbus Error: Failed")
packet = self.modbusTCP.read_holding_registers(280, quantity=6)

View File

@ -17,7 +17,7 @@ class URSentry:
# Flags
self.ESTOP = False
self.await_stop = False
self.await_stop = True
self.await_stop_ticks = 0
self.send_to_zero_on_stop = False
@ -35,6 +35,7 @@ class URSentry:
self.await_stop = True
self.sentry_position()
self.has_initialized = True
self.is_on_sentry_mode = True
def get_joint_angles(self) -> "list[float]":
"""

View File

@ -68,7 +68,10 @@ def find_coords(message: str) -> list[str]:
def run(q: queue.Queue, passwrd : str | None = None) -> None:
base_url = "https://172.22.114.176" # Replace with your UniFi Protect base URL
username = "engr-ugaif" # Replace with your username
password = dotenv.get_key(dotenv.find_dotenv(), "UNIFI_PASSWORD") if passwrd is None else passwrd
if passwrd is None:
password = dotenv.get_key(dotenv.find_dotenv(), "UNIFI_PASSWORD")
else:
password = passwrd
ws_url = "wss://172.22.114.176/proxy/protect/ws/liveDetectTrack?camera=668daa1e019ce603e4002d31" # Replace with your WebSocket URL
cookies = get_token(base_url, username, password)