In this Instruction we are going to modify WiimoteLib by including a new event trigger that is activated upon a change in either Quad or Zone value.
This is a very useful addition that allows for “singular” triggering so that you don’t have to rely on “flag checks” within the standard WiimoteState loop and thus allowing the Libary to do all the work!
Before we start, this instruction assumes you have previously completed the Areas Quad and Zone Instruction.
Start off by opening up the Events.cs file and add the following code below the public class WiimoteChangedEventArgs: Read..
Here we have another step down the path towards full Balance Board Orientation. This time out we are going to merge the Quadrant and Quadzone functionality into a new collective known as “Area” (for want of a better name).
Please note that this instruction assumes familiarity with the Quadrant and Quadzone instructions.
Similar to the Grouping GOG instruction we are going to start by modifying the DataTypes.cs file by grouping the two existing definitions by grouping them together in a new struct.
Replace both the Quadrant and Quadzone definitions with the following singular block of code:
/// <summary>
/// Area of most Weight/COG
/// </summary>
[DataMember]
public Area Area;
Next we are going to add the new struct so that we can use this definition. Below the BalanceBoardState struct add the following code: Read..
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:
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)
A bit of history: Inspired by endquotes WPF implementation of COG I developed an equivalent system for WiimoteLib that provides facility for Dampened COG output. As stated, I find the two systems can be used to compliment each other greatly depending upon the desired application requirement. To me the next obvious step was to group both of the outputs together as two available types under the single banner CenterOfGravity.
Using the format of the Wiimote Test application, once complete this instruction will enable access to each COG output as follows:
There are times when using the WiiFit Balance Board with WiimoteLib that I find it useful to have direct access to which particular “Zone” currently has focus (most weight or COG applied), just think WiiFit areobics etc. Output is fed back as a string which can then be used as desired eg in a switch or if statement etc.
Here’s how its done:
First of all open up Data Types.cs and add the following code block within the BalanceBoardState struct:
/// <summary>
/// Current Balance Board Zone
/// </summary>
[DataMember]
public string Quadzone;
Next open up Wiimote.cs and locate the parse extension function. For convenience sake the following block shorthands the values included with WiimoteLib to help with RSI. Add the following code below the existing COG code just above the break: Read..
There are times when using the WiiFit Balance Board with WiimoteLib that I find it useful to have direct access to which particular “Quadrant” currently has focus (most weight or COG applied), as with the Quadzone Filter just think WiiFit areobics etc.
When used in conjunction with the Quadzone Filter you have the basic tools needed for very simple forms of navigation. As with the Quadzone filter, output is fed back as a string which can then be used as desired eg in a switch or if statement etc.
So without further ado heres how its done:
First of all open up Data Types.cs and add the following code block within the BalanceBoardState struct:
/// <summary>
/// Current Balance Board Quadrant, SJB
/// </summary>
[DataMember]
public string Quadrant;
Next open up Wiimote.cs and locate the parse extension function. For convenience sake the following block shorthands the values included with WiimoteLib. The code is the same as that used in the Quadzone tutorial so if you have already implemented it there you can skip this step, otherwise add the following code below the existing COG code just above the break: Read..
Inspired by endquotes WPF implementation of COG I have developed an equivalent system for WiimoteLib that provides the library with facility for Dampened COG output. I find the two systems can be used to compliment each other greatly depending upon the desired application requirement. Before you start this instruction assumes use of a raw copy of WiimoteLib 1.7
Here is how its done:
Open up Data Types.cs and within the public struct BalanceBoardState add the following blocks of code: Read..
The formula for calculating BMI is a simple one and can be defined as follows:
BMI = Weight in kilograms / height in meters² – Metric
BMI = (weight in pounds * 703 ) / height in inches² – Imperial
The following function is passed a WiimoteState value ws and returns BMI as a double. The division by 100 is used to convert a cm user_height value into meters and can quite easily be replaced/removed if desired. Read..
Today is a good day. After a exactly one year and two days, I have finally cracked the enigma of Balance Board Orientation, and have a version which robust enough for release.
Needless to say I am overjoyed, check out the video:
During the last year I have developed numerous implementations for the task, most of which worked, however none strong enough to deal with the heterogeneous error known as untrained users, however no more!
I am now working on implementing the system fully within both WiimoteLib and the WiiCi driver. Check back soon for more details.
As a general rule, Microsoft expect you to uninstall MSI applications from the Add/Remove Programs tool in the Control Panel.
Sometimes however, its nice to add a Start->Programs Menu – ‘Uninstall Shortcut’ to facilitate this action, for user convenience.
The following post details adding such a shortcut to a simple MSI build in Visual Studio 2008.
Browse to the MSI project folder (using Windows Explorer), right click and select New->Shortcut from the context menu. In the Create Shortcut Wizard dialog that pops up type ‘%windir%\system32\msiexec.exe -x {prodCode} ‘ as the location of the shortcut, where prodCode is the Product Code of the MSI package.
This Product Code can be identified from the Project Properties of the MSI Project in Visual Studio. Also, provide a proper name for the shortcut Read..