Code: Select all
def update():
# Apply deadband filter to avoid drift
# And continousRotation filter to yaw axis to avoid jumps when passing tracker center
x = filters.deadband(filters.delta(math.degrees(filters.continuousRotation(android[0].yaw))), deadband) # Changed from android[0].pitch to android[0].yaw
y = filters.deadband(filters.delta(math.degrees(filters.continuousRotation(android[0].roll))), deadband) # Changed from android[0].yaw to android[0].roll
mouse.deltaX = x * multiply
mouse.deltaY = y * multiply
if starting:
deadband = 0.01
multiply = 40
android[0].update += update
1. After the first time running the FreePIE app on my phone (where it worked fine), after rebooting my phone, I could not get the app to work again. It crashed every time I turned it on.
2. During that first time when I got it to work, I noticed that the mouse cursor hitched every second. I tried a different script that had debug variables for Pitch Yaw and Roll, and I observed in the "Watch" panel that the inputs from my phone were doing the same thing: every second, the inputs stopped for a some milliseconds and then continued.
I don't think this behavior is being caused by my phone's hardware or my network connection, because when I tested it with a different gyro mouse app, there was no hitching. Unfortunately that app won't run in the background like FreePIE can (and it's skeezy and closed source).