pigeond pigeond

pigeon's blog - the pigeon concerto in D minor

FlightGear + Wiimote
2007/01/05 14:07:25
flightgear linux

So, we bought a Wii. Amazingly my wife managed to walk-in and bought apparently the second last Wii in that shop, on the first day of the release in Australia. We also got an extra Wiimote, Zelda the game, and two Wiimote grip protectors.

With thanks to WMD, you could use the Wiimote under Linux fairly easily. For those who don’t know Wiimote talks to the Wii console via bluetooth. So it works with any computer with bluetooth as well.

People have been using the Wiimote on the computers in all sorts of different ways. As a guitar (Wiitar), as a drum machine, for games like Counter Strike, a virtual light sabre, etc. As for me, using the Wiimote with a flightsim, like FlightGear, would naturally be the first thing I wanna try.

The Wiimote has three accelerometers for the three axes. I’ve modified slightly the WMD script to send the X and Z force to the uinput device as the absolute coordinates. jscal then takes care of the calibration of the two axes. Then I changed the commandMap in the script to send BTN_0 to BTN_9 from all the buttons on the Wiimote.

On the FlightGear side all I need is to write a joystick definition XML for the Wiimote. I’ve also made the ‘B’ button to be the modifier. For example I have arrow Up and Down for throttle, Left and Right for the rudder. Then if I hold down ‘B’, Up Down Left Right become panning the viewport. ‘1′ and ‘2′ for changing views, ‘+’ and ‘-’ for zooming in and out, ‘A’ for brakes and gears. All set. Now I can fasten my seatbelt^H^H^H^H^H^H^H^Hwrist strap, sit back and ready for take off.

Updated 5th Jan 2007: Here is a patch against WMD SVN repository. Like I said it’s pretty hacky at the moment. And you definitely have to use jscal to calibrate it before it will behave sanely. Also you probably want to make changes to the commandMap in wmd/Config.py to map more buttons.

And for those FlightGearers out there, here is the Wiimote joystick XML config I’ve made.

Here’s a video of FlightGear + Wiimote in action:




2 comments to “FlightGear + Wiimote”


Piojosnos
2007/08/12 09:37:12

Woaaaaa!! Really nice… I want one with FG ;-)

reply



Geofferey
2008/12/20 17:42:27

Hi this looks really interesting and I would like to try it out. However your instructions were very vague. Do you think you could post detailed instructions for everyone to see?

reply





Leave your comments for
“FlightGear + Wiimote”

(required)
(required, not shown to public)
comments:

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.





blog top 24 tags
api bonding debian engrish fglive fgmap flightgear google ISP laptop lca2007 lca2008 linux live map mpserver navaids network qotd quote of the day taiwan vim windows wine
Search
 
Web pigeond.net









this site is
created with vim



nearly all pages in this site are validated as
Valid HTML 4.01!

css validated by
Valid CSS!


pigeond.net copyright 2001 - 2014
designed, created, and coded by pigeon at pigeond dot net
all rights reserved