BrianPeek.com

A Compendium of Random Uselessness
in Search

Wiimote IR pointer math

Last post Thu, Oct 9 2008 9:40 PM by GrahamRanson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • Tue, Jul 29 2008 12:22 AM

    Wiimote IR pointer math

    [See next post]
  • Tue, Jul 29 2008 6:49 PM In reply to

    • GameQ
    • Top 50 Contributor
    • Joined on Tue, Jul 29 2008
    • Posts 4

    Re: Wiimote IR pointer math

    Reposted with formatting (I am the anonymous poster also, hello world!): 

    First off a little explanation of my project. I've been writing a high level WiimoteMote manager class in C# that talks to Brian's library which provides the low level, basic data reported by the Wiiimote. My manager facilitates the connection of multiple Wiimotes, and accessing their data. It's also a static class that never needs to be instantiated. It cleans up the mess of multiple Wiimote variable, and the best part is that I no longer have to worry about the scope of my Wiimotes, I have access to their data at all times, and there are no globals.

     Onto the math. Which always trips me up. My class is supposed to give me higher level data, that has more practical usages. I have already converted the Accelerometer data into degrees of 0-+/-180, which is very handy when manipulating rotation matrices. But now I'm onto the IR sensor which is probably the most important, and harder. The Raw/Normalized data is almost useless when it come to IR. Once I tilt the wiimote (which somrwhat happens naturally) the IR appear to move in respect to the Wiimote. Once you hit a large angle, your movements become completely misrepresented (actually they are being represented x degrees off, where x=roll of wiimote). Open up Brian's handy test app, rotate your wiimote 90 degrees and try to move those dots, everything is 90 degrees off. In other word the Wiimote always thinks its up-right, so when a dot "moves closer to the B button" it thinks its going +y in wiimote spaces, but the user is moving it +\-x in real world space.How do we counter act that mathematically,so that no matter if my wiimote is rotated 0,45,90,180,76.92 degrees, moving my arm up, equals moving the cross hair up.

     I found this algorithm on WiiBrew.org, in case it helps: Once we know the two dots of the sensor bar, we rotate the sensor field to make the two dots appear on a horizontal line (using the accelerometer values to make sure we're in the right quadrant if the wiimote is upside down). The angle of rotation corresponds to the angle of the wiimote as reported to the software.

    Thanks,

    ~Quinn

  • Thu, Oct 9 2008 9:40 PM In reply to

    Re: Wiimote IR pointer math

    Hi, did you ever manage to find a solution to the IR problem? Also, could you explain how you converted the acceleromoter date into degree form? 

    Thanks

     Graham

Page 1 of 1 (3 items)
Copyright (C) 2008 Brian Peek
Powered by Community Server (Commercial Edition), by Telligent Systems