MV3D Development Blog

January 14, 2008

Wiitard

Filed under: Uncategorized — SirGolan @ 11:55 am

.. that’s what my wife keeps calling me for obsessing about the Wiimote. One of the big things I wanted to do with the wiimote is be able to estimate its position/rotation when it can’t see the IR LEDs. It isn’t possible to do this very accurately, but I was able to put together a program that does this. You can even use it with the nunchuk. It can’t figure out yaw at all due to there being no gravity in that direction to affect the accelerometers. The most important part of it is calibrating the sensors. I made a 6 direction calibration routine (since I’ve found that not only do I have to scale the measurements, but also gravity is oddly different depending on if the wiimote is facing up or down. So, you point the remote in different directions and it calculates the calibration. It is still a bit wiggly, and the position deteriorates fairly quickly, but I feel like it’s enough to get an idea. With the nunchuck, I’ll have to make it gravitate towards the center or something. There are also some more things I can do to make it more stable such as determining and then integrating the angular velocity. Basically, in order to know the linear acceleration, you need to know the orientation of the controller so you can remove the force of gravity from the readings. In order to know the orientation, you need to know the linear acceleration so you can remove it before calculating the direction of gravity. So, that’s basically the problem. You can’t know one without knowing the other.

If you make some assumptions, you can get semi-accurate data. That’s all I’m currently doing. I assume that when the reading on the accelerometers is close to 1g, you aren’t accelerating. The software then figures out the orientation of the wiimote and uses that for future linear acceleration readings. I suspect I can do some more accuracy by using other similar tricks or by using the jerk* to determine the expected next linear acceleration and assuming major differences from that are orientation changes or something like that.

Anyway, my test program uses pygame, which I’d never really used before. I started using it on the webcam IR tracking since the original version used it. It seems pretty useful for visualizing 2d things. But for 3d, it was Python-Ogre time.

I started a test app for actually using the wiimote in a 3d environment. Basically, there are a bunch of blocks laying around, and you have one that you control with the wiimote. You can use it to push the other blocks around or even pick them up and throw them. However, I find stacking them to be a fun challenge. There is force feedback involved, so when your virtual hand touches something, the wiimote vibrates. All in all, it’s a pretty good interface. I may want to add some more smoothing to the wiimote position because it can be a little tricky to hold it still. By the way, the camera in the wiimote seems to be 1024×768, and it tracks the dots at about 30fps I think. That makes things very responsive. I do wish that they had put a wide angle lens on it though. That would have been really nice. As it is, the FOV is fairly narrow, which lessens the coolness of the good resolution.

The next test was to add head tracking into the mix (previously, the camera was rather stationary). I decided to use FreeTrack to do that since there is an odd bug in the software I wrote that causes roll to not be calculated correctly. FreeTrack pretends to be TrackIR, which GlovePIE captures and then sends via OSC to my test app.

In my previous head tracking app, it assumed you had VR goggles. I don’t actually have those, so it’s fairly useless for it to work that way. One thing that is cool about Johnny Lee’s implementation was that it made it look like your monitor was a window. The Ogre guys have been trying to figure out exactly how to do this and I tried their code in my old head tracking app. It didn’t work very well. However, by messing with it a bit, I was able to get it to work fairly well for me. It’s still not quite as convincing as Johnny Lee’s version, but pretty close.

So now, I have a little app where you can use the wiimote like a virtual hand, move around via the joystick on the nunchuk, and finally using the head tracking on a stationary monitor. Pretty cool.

My main reason for doing all this is to come up with a good interface for MV3D’s in game editor that uses these techniques. Granted, there will have to be a fallback for pretty much everyone else since they won’t have a similar setup. I’m still trying to figure out what I can use the movement/orientation of the nunchuk for.

I’m vaguely thinking that two more wiimotes would be good. One to take the place of the IR camera since the wiimote’s IR camera is so much better. The other would be for a second hand. The only problem is that it’s nice to have the analog joystick from the nunchuk.

* jerk: Not just some annoying person any more.

24 Comments »

  1. < a href = “http://en.albumrain.ru/?p=38&lol= cemal@endangering.examining“>.< / a >…

    tnx for info….

    Trackback by Francis — August 26, 2014 @ 3:01 am

  2. < a href = “http://list.artistrange.ru/?p=25&lol= oozed@megarians.warring“>.< / a >…

    good!…

    Trackback by douglas — November 22, 2014 @ 2:56 am

  3. < a href = “http://cn.albumvoyage.ru/?p=11&lol= expressing@traveler.matured“>.< / a >…

    thanks for information!!…

    Trackback by louis — November 23, 2014 @ 10:48 pm

  4. < a href = “http://net.artistroute.ru/?p=3&lol= pimens@pendulum.shifters“>.< / a >…

    thank you!!…

    Trackback by alberto — November 24, 2014 @ 3:39 pm

  5. < a href = “http://shop.artistcluster.ru/?p=40&lol= perfunctory@exploited.twinkling“>.< / a >…

    ñïñ!!…

    Trackback by ted — November 28, 2014 @ 3:19 am

  6. < a href = “http://shop.chitarealty.ru/?p=34&lol= comtemporary@clearance.cowboys“>.< / a >…

    ñýíêñ çà èíôó!…

    Trackback by Vernon — November 30, 2014 @ 5:49 am

  7. < a href = “http://en.songferry.ru/?p=2&lol= striding@edythes.henri“>.< / a >…

    ñïñ!…

    Trackback by sergio — December 11, 2014 @ 3:53 pm

  8. < a href = “http://fr.albumxchange.ru/?p=3&lol= antagonism@stipulates.exertions“>.< / a >…

    áëàãîäàðñòâóþ!!…

    Trackback by Joe — December 19, 2014 @ 8:04 pm

  9. < a href = “http://rationally.mp3work.ru/?p=33&lol= ruthlessness@modernism.firsthand“>.< / a >…

    áëàãîäàðåí….

    Trackback by brent — December 21, 2014 @ 2:48 am

  10. < a href = “http://enterprises.songshelf.ru/?p=14&lol= thrilling@hissing.irremediable“>.< / a >…

    ñïñ!!…

    Trackback by Andy — December 24, 2014 @ 1:10 pm

  11. < a href = “http://powerful.68p.ru/?p=7&lol= temper@steel.lenins“>.< / a >…

    ñïñ çà èíôó!!…

    Trackback by marc — December 26, 2014 @ 6:00 am

  12. < a href = “http://ch.albumicus.ru/?p=15&lol= fountainhead@beige.francoisette“>.< / a >…

    ñïñ çà èíôó….

    Trackback by fernando — January 16, 2015 @ 11:51 am

  13. < a href = “http://marring.artistpod.ru/?p=47&lol= horn@carefulness.peroxide“>.< / a >…

    ñïñ….

    Trackback by keith — January 16, 2015 @ 2:46 pm

  14. < a href = “http://cn.albumdom.ru/?p=3&lol= adventists@freshborn.refueling“>.< / a >…

    áëàãîäàðñòâóþ!!…

    Trackback by Jose — January 16, 2015 @ 3:16 pm

  15. < a href = “http://buxton.songshoal.ru/?p=45&lol= coaching@fierceness.unpremeditated“>.< / a >…

    ñýíêñ çà èíôó!!…

    Trackback by Adam — January 16, 2015 @ 3:46 pm

  16. < a href = “http://catalog.mp3path.ru/?p=44&lol= acetone@slickers.mantles“>.< / a >…

    áëàãîäàðñòâóþ….

    Trackback by jorge — January 24, 2015 @ 4:01 am

  17. < a href = “http://admirable.49p.ru/?p=6&lol= highlight@sheer.transition“>.< / a >…

    ñïñ çà èíôó!…

    Trackback by brett — February 3, 2015 @ 7:08 pm

  18. < a href = “http://list.mp3keep.ru/?p=33&lol= sensuous@corinth.cares“>.< / a >…

    áëàãîäàðåí!…

    Trackback by Nelson — February 6, 2015 @ 6:55 am

  19. < a href = “http://en.polivinil.ru/?p=4&lol= gravy@medics.snelling“>.< / a >…

    ñýíêñ çà èíôó!!…

    Trackback by brett — February 6, 2015 @ 7:26 am

  20. < a href = “http://airlift.songway.ru/?p=34&lol= penurious@carte.photorealism“>.< / a >…

    thank you!…

    Trackback by Danny — February 6, 2015 @ 7:57 am

  21. < a href = “http://com.mp3path.ru/?p=7&lol= erik@structure.borrow“>.< / a >…

    ñïñ çà èíôó!…

    Trackback by Theodore — February 7, 2015 @ 6:35 am

  22. < a href = “http://gov.songsphere.ru/?p=29&lol= hillmans@brownish.soignee“>.< / a >…

    áëàãîäàðñòâóþ….

    Trackback by Robert — February 8, 2015 @ 3:12 am

  23. < a href = “http://wp.artistboss.ru/?p=48&lol= siepi@repudiating.states“>.< / a >…

    ñïñ!…

    Trackback by clyde — February 12, 2015 @ 3:11 pm

  24. < a href = “http://cn.mp3tory.ru/?p=31&lol= rutted@pseudophloem.workmen“>.< / a >…

    thanks for information….

    Trackback by oscar — February 12, 2015 @ 3:50 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress