Skip to content

Instantly share code, notes, and snippets.

@LeoDJ
Created January 6, 2021 13:55
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 LeoDJ/1b6a663e72e694b5d0202c4f1144ab1e to your computer and use it in GitHub Desktop.
Save LeoDJ/1b6a663e72e694b5d0202c4f1144ab1e to your computer and use it in GitHub Desktop.
Read raw values for 3DConnexion SpacePilot / SpaceMouse / SpaceNavigator
import spacenavigator
import time
def callback(s):
print("X: %5.2f Y: %5.2f Z: %5.2f Roll: %5.2f Pitch: %5.2f Yaw: %5.2f Buttons:" % (s.x, s.y, s.z, s.roll, s.pitch, s.yaw), s.buttons)
success = spacenavigator.open(callback)
if success:
while 1:
time.sleep(0.1)
else:
print("No device")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment