measurment client and server example
This commit is contained in:
parent
a872232880
commit
8fc5ad9868
|
@ -2,7 +2,7 @@ import socket
|
||||||
|
|
||||||
HOST, PORT = "localhost", 42424
|
HOST, PORT = "localhost", 42424
|
||||||
|
|
||||||
robot_id = 15
|
robot_id = 11
|
||||||
|
|
||||||
# SOCK_DGRAM is the socket type to use for UDP sockets
|
# SOCK_DGRAM is the socket type to use for UDP sockets
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
|
|
@ -35,11 +35,11 @@ class MeasurementServer(socketserver.ThreadingMixIn, socketserver.UDPServer):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
aruco_estimator = ArucoEstimator(use_realsense=False, robot_marker_ids=[15])
|
aruco_estimator = ArucoEstimator(use_realsense=True, robot_marker_ids=[11, 12, 13, 14])
|
||||||
estimator_thread = threading.Thread(target=aruco_estimator.run_tracking)
|
estimator_thread = threading.Thread(target=aruco_estimator.run_tracking, kwargs={'invert_grayscale': True})
|
||||||
estimator_thread.start()
|
estimator_thread.start()
|
||||||
|
|
||||||
with MeasurementServer(('127.0.0.1', 42424), MeasurementHandler, aruco_estimator,
|
with MeasurementServer(('0.0.0.0', 42424), MeasurementHandler, aruco_estimator,
|
||||||
max_measurements_per_second=30) as measurement_server:
|
max_measurements_per_second=30) as measurement_server:
|
||||||
measurement_server.serve_forever()
|
measurement_server.serve_forever()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user