Last active
June 7, 2019 03:27
-
-
Save eziosoft/349e8b1aa7caddfcca3b6967fb93b385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
s = "" | |
vision_server_client.send("g".encode()) # send 'g' to get response | |
clock.tick(5) | |
s = vision_server_client.recv(10000) # there must be a better way to do this | |
markersDict = json.loads(s.decode()) | |
except: | |
continue | |
aruco_markers = markersDict["aruco"] | |
for m in aruco_markers: | |
x = int(m['center']['x']) | |
y = int(m['center']['y']) | |
s = int(m['size']) | |
h = (m['heading']) | |
marker_id = int(m['ID']) | |
corners = m['markerCorners'] | |
try: | |
xm, ym, zm, roll_marker, pitch_marker, yaw_marker = getMarkerAttitude(corners, 10) # for extra info, openCV needed | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment