Skip to content

Instantly share code, notes, and snippets.

@eziosoft
Last active June 7, 2019 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eziosoft/349e8b1aa7caddfcca3b6967fb93b385 to your computer and use it in GitHub Desktop.
Save eziosoft/349e8b1aa7caddfcca3b6967fb93b385 to your computer and use it in GitHub Desktop.
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