Brian has done it again, check out the following cross-posting from brianpeek.com detailing beta support for the Wii Motion Plus:
I have posted a new version of WiimoteLib as a beta for people to play around with the Wii MotionPlus accessory. Please note that this is not a stable release and should only be used if you wish to mess around with the MotionPlus. Also note that only C# source code is included in this release as it is not a final build. Here’s the change log:
v1.8.0.0
- Taiko Drum Master’s TaTaCon drum controller supported (Dean Herbert)
- Bare-bones Wii MotionPlus support (wiibrew.org, testing by Tyler Tolley)
- WiimoteTest UI changed to add MotionPlus data
- Please note that the current version is VERY flakey and may not work at all for you.
- Pair your Wiimote, plug in your MotionPlus, call InitializeMotionPlus()
- Extensions plugged into the MotionPlus will give wacky results…not supported…yet!
- Internal changes to perhaps fix some threading issues
So remember, it’s a beta, it may not work for you, and the data you’ll get back from the accessory is just the raw data it provides. You won’t get real orientation values.
That said, head over to CodePlex and give it a try! (Brian Peek)
Great work Brian!
Here is a Cross Post from brianpeek.com detailing Brian’s current progress with the Wii Motion Plus: Source
Ok, I get about 10 emails a day on this, so I figure a status update is in order.
The Wii MotionPlus extension for the Wiimote was released last week. Since then, I and others have been working to figure out how the device works. Unfortunately, it does NOT work as every other extension controller has worked up until this point, mostly due to the fact that the Wii MotionPlus accessory has an expansion port of its own so all of the other extension controllers can plug into it.
In the past few days, some progress has been made thanks to the folks over at wiibrew.org, although functionality is nowhere near complete. For example, it’s currently impossible to have the Wiimote notify you when the Wii MotionPlus is inserted into the bottom of the Wiimote, like all of the other extension controllers do.
I have been working with the information at wiibrew.org and am trying to get things working reliably with my library so that developers can actually get some degree of functionality out of it.
So, all that said, expect to see a new (likely beta) version of WiimoteLib “soon” that has some bare-bones Wii MotionPlus functionality included. It won’t be perfect, complete, or bug free, but it will allow you to tinker with the device a bit. I will update my blog when the new version is available. Thanks!
Brian Peek has put up the latest version of WiimoteLib at CodePlex.
He states that the changes for this release are as follows:
- Writing registers is now properly waiting for the Wiimote to reply before continuing…this removes all of the Thread.Sleep() calls and should *greatly* improve performance when setting LEDs and rumble (Serial Nightmare & wwibrew.org)
- Guitar Hero: World Tour Guitar and Drums now properly recognized and used (wiibrew.org, tested by Tyler Tolley and Mauro Milazzo)
- Guitar whammy bar is now a 5-bit value instead of 4 (wiibrew.org)
- Position of 4 IRs now properly reported in Basic reporting mode (Dan Carter)
- Found1/2 now properly reported in MSRS (reported by akka243)
- MSRS project updated to Microsoft Robotics Developer Studio 2008
Brian Peek has released a new project over at the Coding4Fun site, that utilizes my balance board code (cool) the following has been taken from his site:
I previously talked about my WiiEarthVR project shown at PDC project, and now I have posted the article for the application up at the Coding4Fun site. Full source code is available. You’ll need some hardware to make this go, namely a Wiimote, Nunchuk, Wii Fit Balance Board and a pair of Vuzix VR920 glasses, but the hardware can be toggled on or off depending on your own setup. The VR920 glasses are pretty cool in that they also work with a variety of FPS games on your PC with a custom driver they include.
The article will, among other things, teach you how to use Virtual Earth 3D from a managed host (i.e. a WinForms app, not a web page), how to talk to the Wiimote, Nunchuk and Wii Fit Balance Board, how to retrieve the head tracking data from the VR920 glasses from .NET, and how to draw stereoscopic 3D images to the VR920 glasses from .NET. Quite a bit packed in there…
Anyway, have a read and, as always, questions and comments are welcome.
The following details the steps needed to integrate facility for calculating a Balance Board users Center Of Gravity (COG) within Brian Peeks WiimoteLib version 1.5.2. COG is useful for the implementation of Windows based WiiFit style applications.
Open up Datatypes.cs and add the following to public struct BalanceBoardState: Read..
Open up Datatypes.cs and add the following definitions to the public struct BalanceBoardState:
/// <summary>
/// Stones per sensor
/// </summary>
public BalanceBoardSensorsF SensorValuesSt;
and
/// <summary>
/// Total stones on the Balance Board
/// </summary>
public float WeightSt;
Next open up Wiimote.cs and add the following variable above the default constructor just below the Kg – Lb vars:
// kilograms to stones
private const float KG2ST = 6.35029318f;
Next we are going to add the code that populates these definitions/variables
Still within Wiimote.cs add the following code to the BalanceBoard case of the ParseExtension function just below the Kg – Lb equivalent code:
mWiimoteState.BalanceBoardState.SensorValuesSt.TopLeft = (mWiimoteState.BalanceBoardState.SensorValuesKg.TopLeft / KG2ST);
mWiimoteState.BalanceBoardState.SensorValuesSt.TopRight = (mWiimoteState.BalanceBoardState.SensorValuesKg.TopRight / KG2ST);
mWiimoteState.BalanceBoardState.SensorValuesSt.BottomLeft = (mWiimoteState.BalanceBoardState.SensorValuesKg.BottomLeft / KG2ST);
mWiimoteState.BalanceBoardState.SensorValuesSt.BottomRight = (mWiimoteState.BalanceBoardState.SensorValuesKg.BottomRight / KG2ST);
The above block of code enables calls to be made to obtain values for each of the four sensors in exactly the same way as you would for Kg’s and Lb’s e.g.
TopLeftInStones = ws.BalanceBoardState.SensorValuesSt.TopLeft;
Finally for total weight in stones add the following line below the equivalent Kg / Lb definitions:
mWiimoteState.BalanceBoardState.WeightSt = (mWiimoteState.BalanceBoardState.SensorValuesSt.TopLeft + mWiimoteState.BalanceBoardState.SensorValuesSt.TopRight + mWiimoteState.BalanceBoardState.SensorValuesSt.BottomLeft + mWiimoteState.BalanceBoardState.SensorValuesSt.BottomRight) / 4.0f;
And there you have it your balance board will now cater for the UK Stones measure and calls can be made using equivalent code to that provided for Kg’s and Lb’s.
In an effort to put out more frequent builds with fewer changes, Brian peek has released WiimoteLib v1.4 to CodePlex. This release contains the single most requested feature: multiple Wiimote support.
The original Coding4Fun article has also been updated with some details on how to use multiple Wiimotes, as has the WiimoteTest application included with the distribution.
Changes
- Multiple Wiimotes supported!
- Slight change to ExtensionType enum for better extension detection
- Decided I didn’t like the dependency on System.Drawing for the 2D point so am now using my own Point structs. Sorry…
- WiimoteTest app updated to show multiple Wiimotes working
SOURCE: Brian Peek