Improve tracking (keep original axes from Joy-Con)
This commit is contained in:
parent
298d18525b
commit
7f149cd412
1 changed files with 2 additions and 9 deletions
|
@ -286,15 +286,8 @@ class JoyDance:
|
|||
return
|
||||
|
||||
try:
|
||||
accels = self.joycon.get_accels() # (x, y, z)
|
||||
|
||||
# Accelerator axes on phone & Joy-Con are different so we need to swap some axes
|
||||
# https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/imu_sensor_notes.md
|
||||
for accel in accels:
|
||||
x = accel[1] * -1
|
||||
y = accel[0]
|
||||
z = accel[2]
|
||||
self.accel_data.append([x, y, z])
|
||||
accels = self.joycon.get_accels() # ([x, y, z],...)
|
||||
self.accel_data += accels
|
||||
except OSError:
|
||||
self.disconnect()
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue