mirror of
https://github.com/UGA-Innovation-Factory/UR10-Sentry.git
synced 2026-01-29 17:07:03 +00:00
dockerfile ready
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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]":
|
||||
"""
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -17,6 +17,6 @@ COPY BBoxProcessor.py .
|
||||
COPY URSentry.py .
|
||||
COPY dockermain.py .
|
||||
|
||||
ENV UNIFI_PASSWORD = ''
|
||||
ENV UNIFI_PASSWORD=''
|
||||
|
||||
CMD [ "python", "./dockermain.py" ]
|
||||
Reference in New Issue
Block a user