Skip to content

Commit

Permalink
Improve tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
redphx committed May 7, 2022
1 parent 35906a7 commit 3ef5001
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions joydance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ async def collect_accelerometer_data(self):

# 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
accel = accels[2]
x = accel[1] * -1
y = accel[0]
z = accel[2]
self.accel_data.append([x, y, z])
for accel in accels:
x = accel[1] * -1
y = accel[0]
z = accel[2]
self.accel_data.append([x, y, z])
except OSError:
self.disconnect()
return
Expand Down
8 changes: 4 additions & 4 deletions joydance/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class WsSubprotocolVersion(Enum):
WS_SUBPROTOCOLS[WsSubprotocolVersion.V1.value] = 'v1.phonescoring.jd.ubisoft.com'
WS_SUBPROTOCOLS[WsSubprotocolVersion.V2.value] = 'v2.phonescoring.jd.ubisoft.com'

FRAME_DURATION = 1 / 60
SEND_FREQ_MS = 0.005
ACCEL_ACQUISITION_FREQ_HZ = 60 # Hz
ACCEL_ACQUISITION_LATENCY = 40 # ms
FRAME_DURATION = 0.015
SEND_FREQ_MS = 0.05
ACCEL_ACQUISITION_FREQ_HZ = 200 # Hz
ACCEL_ACQUISITION_LATENCY = 0 # ms
ACCEL_MAX_RANGE = 8 # ±G

DEFAULT_CONFIG = {
Expand Down

0 comments on commit 3ef5001

Please sign in to comment.