How can I improve gyroscope tracking for the Wiimote when increased speed is applied to the movements? Right now I have pretty good tracking if I move slowly. But the moment I move too fast from one direction to the other, the cursor will track poorly, causing large, random jumps in mouse cursor movements. Often times the jumps will express itself as sharp vertical movements when the wiimote is moved horizontal. The opposite happens as well.
I tried applying a deadband to motionplus.pitch_left and motionplus.yaw_down, but I cannot solve the inaccuracies caused by fast movements. I also tried the deadband on ahrs.yaw and ahrs.pitch, but it seems they behave more or less similarly with fast movements.
the code I use for mouse tracking with the wiimote is:
Code: Select all
yaw = filters.deadband((wiimote[0].motionplus.yaw_down), 0.15)
pitch = filters.deadband((wiimote[0].motionplus.pitch_left), 0.15)
if wiimote[0].buttons.button_down(WiimoteButtons.A):
mouse.deltaX = yaw/-9
mouse.deltaY = pitch/9