Author Topic: Pitch and Yaw in stationary position coding help with motionplus  (Read 4807 times)

Offline antmorton

  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Hi guys

I'm in my final year at uni and am doing an interactive sound piece using the wii remote as kind of a head tracker. I only need the pitch and yaw in a single point. The user will be stood still with a wii remote with the motion plus attached to a pair of headphones. The values are then converted to midi which controls a specific VST plugin I have made.

The problem I am having is that my yaw 0 point is always changing. It starts at 0 fine, but sometimes it starts to increase without any movement. With a few minutes of rotational movement it's 0 point changes to a different direction/angle. I need the centre point to remain in the same place.

Also my pitch is jumping quite a lot although seams to work and its centre point always remains the same when the remote is laid flat.

I'm not a very competent coder and thus really need some help please!


This is the simple code I'm using:

//
var.Yaw = Wiimote.Yaw
var.Pitch = Wiimote.Pitch


midi2.Control30= (EnsureMapRange(var.Pitch, 90,-90, 0,1))
midi2.Control31= (EnsureMapRange(var.Yaw, -45,225, 0,1.5))

//


Extremely basic I know, but like I said, I aint very good at code!!


The ranges are for compatibility with my plugin, that's why it may seam a bit wierd at first glance!



Offline antmorton

  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Can anyone help me please?




Offline hank

  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Have you resolved your problem? I am a newbie to motion detection myself but just some ideas...

Are the Wiimote.Yaw and Wiimote.Pitch data structures pre-filtered data or just the "almost raw" data from the accelerometers? It makes sense that your Pitch data is more accurate because there is gravity as a reference point. It would be harder to measure movement in the horizontal plane. So you might need more filtering to get the results you want.



Offline shakespeare1212

  • *
  • Posts: 97
  • Karma: +0/-0
  • The soul of Dr. Nuclear
    • View Profile
    • Whalebone IR and Software
This not coding related but it may be important. It seems to me that if the Wii remote is attached to head phones on top of a person's head then the pivot point would be at the person's neck and not at the wii mote control as it would be when the control is sitting on a table.

I hope that this observation helps.

James.

James Mclain
Owner and Creator of
Whalebone IR and Software

http://whaleboneir.com

or view and buy our products on ebay:

http://ebay.com   Search for IR pen or products by shakespeare1212.