Ticket #63 (closed enhancement: fixed)

Opened 7 years ago

Last modified 4 years ago

Wii Balance Board support patch + demo program

Reported by: TBBle Owned by: dsmith
Priority: major Milestone:
Component: libcwiid Version:
Keywords: balance board Cc:

Description

I've created a patch against current SVN trunk (r179) which enables support for the Wii Balance Board. It treats the Wii Balance Board as just another extension controller, and exposes a single new method, cwiid_get_balance_cal. Apart from that, if you replace 'CLASSIC' with 'BALANCE' in the Classic Controller API, then you should be able to find the appropriate structures quite easily.

I've only updated the core libcwiid and the wmdemos and the Python binding. I'm hoping others will pick up the C# binding, wmgui and wminput. I may try to create a wminput plugin at a later date that transforms your lean direction into a joystick-type input direction.

I've also included a python script which can be used as a very basic weighing machine. I'm particularly keen that people try this to validate my calibration code. Also, I suspect it shows up either a bug in cwiid, or a bug in my understanding of the Python interface, as some times ext_type is not set in state, and sometimes it is. If the program fails to start because it doesn't think you have a Wii Balance Board, keep trying.

Attachments

balance.diff Download (17.4 KB) - added by TBBle 7 years ago.
Patch to cwiid to support the Wii Balance Board
weighdemo.py Download (2.0 KB) - added by TBBle 7 years ago.
Demonstration Python script for the Wii Balance Board
scalesgui.py Download (6.4 KB) - added by micolous 6 years ago.
Simple PyGame? app to read your weight and leaning position
system.ini Download (0.5 KB) - added by micolous 6 years ago.
Configuration file for scalesgui.py

Change History

Changed 7 years ago by TBBle

Patch to cwiid to support the Wii Balance Board

Changed 7 years ago by TBBle

Demonstration Python script for the Wii Balance Board

Changed 6 years ago by micolous

According to Wikipedia:  http://en.wikipedia.org/wiki/Wii_Balance_Board

"Although the Japanese packaging states that it is designed to support people weighing up to 136 kg (300 pounds / 21 stone 6lb) and the "Western" Balance Board up to 150 kg (330 pounds / 23 stone 9lb), they are actually the same board. The packaging differ due to the different laws in Japan and other nations regarding weights and measures. While the board will only display weight readings up to what is printed on the packaging, the actual physical structure of the board is able to withstand much greater force equivalent to around 300 kg (660 pounds / 47 stones 2lb).[5]"

Looking at your source code, it appears you're basing it on what the Japanese board supposedly measures. Therefore, I think your calculations will be wrong, as you should be basing it on what is advertised as the weight limit for the Western version (as they are the same board in all regions, and the Western version correctly labels the weight limit).

I noticed when using the board with your patches, it would read my weight as about 80kg, when the Wii Fit game says my weight is about 85~86kg, once I remove the correction the game does for the weight of my clothing.

Therefore, I think you should be assuming that half pressure is 18.75kg, based on 1/8 of the limit of the Western version of Wii Fit. I'm not too sure how the math with this would go, though.

Another alternative would be to dismantle a balance board and check out what ICs are inside, then lookup datasheets for the sensors. Unfortunately the two balance boards I have been using belong to someone else, and I very much doubt they would let me pull it apart!

I wrote a quick hack based on your test program (so still using your calculations) that is a pygame application that reads your weight and figures out your leaning position on the balance board. It's all very hackish. I'll attach it after this comment.

I would very much like to see things like calculation of actual weight and position that the person is leaning moved into the cwiid API itself, so that there isn't code duplication. However, still leave the option for a developer to use the raw values.

Changed 6 years ago by micolous

Simple PyGame? app to read your weight and leaning position

Changed 6 years ago by micolous

Configuration file for scalesgui.py

Changed 6 years ago by jarr

I checked out this branch and applied the patch, but the python demos were not running, quitting with the error 'This program only supports the Wii Balance Board' -- I removed the if from the script, and it works fine; Though, wiimote.stateext_type? is 0. It's a EU board. I wonder if that is different from what else this has been tested on, is it

Changed 6 years ago by dsmith

  • status changed from new to closed
  • resolution set to fixed

Excellent patch - applied. r188

Changed 6 years ago by dsmith

Looks like there may be some issues with how the values out of the balance board are interpretted - I'd like to clear these up before committing the accompanying scripts. Can anyone verify that they produce accurate weights, etc.?

Changed 4 years ago by lamanuk

Note: See TracTickets for help on using tickets.