dyadica.net

Fun and Games in the Dyadic Sea

Posts Tagged ‘balance board’

permalink image comments image
Friday, 31 July '09: Adding The Step Event

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..

Tags: , , , , , , , ,
permalink image comments image
Thursday, 30 July '09: Merging Quadzone and Quadrant

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..

Tags: , , , , , , , , ,
permalink image comments image
Wednesday, 15 July '09: Dampened and Standard COG

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:

// Standard COG
lblCOG.Text = ws.BalanceBoardState.CenterOfGravity.Standard.ToString();
// Dampened COG
lblDampenedCOG.Text = ws.BalanceBoardState.CenterOfGravity.Dampened.ToString();

Before you start this instruction assumes use of a raw copy of WiimoteLib 1.7 and have looked at the Adding Dampened COG to WiimoteLib instruction.

Here is how its done: Read..

Tags: , , , , , , ,
permalink image comments image
Tuesday, 14 July '09: The Balance Board Quadzone Filter for WiimoteLib

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..

Tags: , , , , , ,
permalink image comments image
Tuesday, 14 July '09: The Balance Board Quadrant Filter for WiimoteLib

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..

Tags: , , , , , , ,
permalink image comments image
Tuesday, 14 July '09: Adding Dampened COG to WiimoteLib

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..

Tags: , , , , , , ,
permalink image comments image
Saturday, 11 July '09: Balance Board BMI

Want to be able to calculate your BMI via WiimoteLib so you can use your board ala WiiFit, heres how its done:

Before we start, for a detailed description of BMI please refer to the following Wikipedia article: http://en.wikipedia.org/wiki/Body_mass_index

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..

Tags: , , , , , , , ,
permalink image comments image
Friday, 10 July '09: Real Balance Board Orientation

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.

Tags: , , , , , ,
permalink image comments image
Monday, 16 June '08: Adding facility for COG to WiimoteLib 1.5.2

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..

Tags: , , , , , , ,
permalink image comments image
Monday, 16 June '08: Adding UK Stones measure to WiimoteLib 1.5.2

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.

Tags: , , , , ,

poll tags

css | xhtml | dyadica.net © admin 2010 | powered: wordpress | fuel: ps-wii-elite | top | sign-up