Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

Wednesday, December 03, 2008

Wiimote Gesture Recognition

Up until this post, I assume that you should have played with your wiimote for some days.
You probably have tried to program something with the wiimote library that I've introduced from the previous post.
Now you might come with a question that, how to actually make sense from the data of the accelerometer on the wiimote.
So there are people doing gesture recognition with the wiimote.

I've just realized that to fully utilize the accelerometer that I actually need a gesture recognition software when I was reading the wiimote specifications at Wiili.org.
So the first library that I've discover is the Wiigee which is a java based library.

wiigee is an open-source gesture recognition library for accelerometer-based gestures specifically developed for the Nintendo® Wii™ remote controller. It is implemented in Java™ and, thus, is platform-independent. Using a third-party Bluetooth®-library wiigee allows you to define and recognize your own, freely trained gestures.

The wiigee library
  • allows you to define (train) your own arbitrary gestures,
  • recognizes these gestures with high accuracy,
  • offers an event-driven architecture with which you will be able to
  • integrate the gesture-input as easy as common mouse-input.


Here come some video demo for wiigee.








Even though I've downloaded the library but I haven't got it to work on my pc yet.
As the library require another bluetooth library for java and I've always got an exception about the bluetooth connection stuff.
If any of you manage to get it work on your pc, please don't hesistate to give me an update.


Here there is a library for C/C++ which is called Accelerometer Gesture Recognizer.
I still haven't got it work with my pc either as I still cannot manage to compile it due to unknown reason.

However, there are few alternative C/C++ libraries to it such as Accelerometer-based Gestures for Openmoko Neo FreeRunner which also works for wiimote.
This project was done under the Google Summer of Code 2008 program.



Even though I've never tried to build this library as it is written in C code though but it seems work pretty good from the video demo above.

There is another C/C++ library which is program by a Taiwanese which is WiimoteGR (I found his blog which lead me to this page anyway).
On the wiki page which is linked above, the author even describes how the library work in diagram and some pseudocode.
It is pretty good reference if you want to program a similar library.
I guess that I will use this library for my project as it works fine when I tried to train it with some gestures and have it to recognize the gesture.

Finally, here there is a C# library for those who love managed code which is Wiigle.

Wii-based Gesture Learning Environment
WiiGLE provides support for recognizing gestures based on the Wiimotes accelerometers. The current version features some basic feature calculations on the raw signal and a simple NaiveBayes classifier. To this end, it makes use of the Managed Library for Nintendo's Wiimote by Brian Peek and the Weka Data Mining Software by the University of Waikato. It provides interfaces to integrate your own feature calculations and your own classifiers.

WiiGLE provides and environment to record gestures, calculate features, train classifiers, and use the Wiimote for online gesture recognition based on accelerometer data. It features a Programming API that allows integrating your own features and classifiers.

http://mm-werkstatt.informatik.uni-augsburg.de/documents/WiiGLE/doku.php

There are some good documentations on it and even a video tutorial.
It seems pretty even though I haven't tested it out yet.


So for the few libraried above, most of them are released under LGPL license which allows you to do anything with it either open source or commercial.
This is a good sign for those who want to learn more on it.
You can just download the source code and see what the authors have done.


So now you have the gesture recognition libraries here, let's get it Rock 'n Roll!!

Thursday, November 27, 2008

How to make use of the Wiimote

So now you have your wiimote connected to your PC, isn't it?
You probably tried to press the buttons on the wiimote or even tried to shake it, but nothing happens in the end and the 4 LEDs just keep blinking.
Don't be frustrated, it is because you do not have any programs that read the data from your wiimote and make use of it.
So here I introduce to you few of the wiimote libraries that I've tested anyway.

First, here comes the managed library which is WiimoteLib.
This library started out as an article at the Coding4Fun site and eventually many people use this to develop their projects with wiimote.
For a familiar example, it is also used by Johnny Chung Lee's projects which were posted in the previous post.
Here's a screensot to let you see how it is looked like.



Next, here comes a C library called Wiiuse.
It is one of the very first library that enable you to gain access to the wiimote with your PC, I guess.
For those who like to program in C language, you can go for it as its support for the wiimote is pretty good and it can support most of the bluetooth stack theoritically.



In case that you would like to program in Java, there is a Java wrapper for the Wiiuse above called WiiuseJ.
It is supposed to be able to do whatever the Wiiuse can do though.


Lastly, it is a great news for those who love C++, there is an excellent library for C++ which is WiiYourSelf!.
It is a fully featured library which supports everything from the wiimote even the speaker and vibrator.
This is the library that most recommeded by me as it is really easy to use though.




Here I've introduced several libraries tested by me.
In case you want to know more other libraries available, feel free to visit the URL below.
http://www.wiili.org/index.php/Wiimote_driver