Unity-Wiimote icon indicating copy to clipboard operation
Unity-Wiimote copied to clipboard

Accel doesnt work, gyro drifts instantly. No sensor fusion?

Open odivalq opened this issue 8 years ago • 6 comments

Hi, the unity project seems to work okay, however I get no indication that accelerometer is working. In the vídeo I can see some red lines indicating the direction of the acceleration vectors, but no such thing appears for me.

Also the motion plus drifts instantly after initialization whereas in the vídeo it seems to remain largely reliable for at least a few minutes. Could that be related to the seemingly nonworking accelerometer input?

Having asked these, is there some sort of sensor fusion at work in the API?

Thanks in advance!

odivalq avatar Feb 13 '17 22:02 odivalq

  1. To see the accelerometer line, make sure the "Draw gizmos" button is pressed in the game view (top right).
  2. To minimize motionplus drift, make sure to lay the WMP down flat on a table and click the "Zero out WMP" button
  3. The only sensor fusion I have implemented right now is when you zero out the WMP. this reorients the remote so that it is facing forward and aligned with the accelerometer (assumed to represent gravity).

Flafla2 avatar Feb 14 '17 19:02 Flafla2

Oh, do I feel silly now. Thank you very much Flafla2, it seems to work as intended now. Just one thing: sometimes during playtest of the default scene of the project you suplied some hiccups happens, about twice per minute, and although they barely last half a second they desync the wiimote model orientation with the real one. Any ideas on might be going on?

odivalq avatar Feb 15 '17 14:02 odivalq

@odivalq Perhaps this is an issue with your bluetooth stack? Possibly your bluetooth equipment can't keep up with updates. I'm not completely sure though - it could also be a software issue. Are you getting FPS drops when these issues pop up?

Flafla2 avatar Feb 15 '17 16:02 Flafla2

Hey, I'm trying to work with the Accelerometer data, but from the documentation I can't seem to work out how to actually get the controllers accel data, do you happen to have any example code or anything I could take a look at?

cascross123 avatar Feb 21 '17 17:02 cascross123

@cascross123 See here

Flafla2 avatar Feb 21 '17 19:02 Flafla2

Hey, Thats great, though i'm being thrown errors "Object reference not set to an instance of an object", any ideas?

cascross123 avatar Feb 21 '17 19:02 cascross123