Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Been doing real-time measurements with Mathematica! (Wii Balance

69 views
Skip to first unread message

Sjoerd C. de Vries

unread,
Apr 15, 2009, 4:58:52 AM4/15/09
to
Just wanted to report that for the first time in my life I've been
using Mathematica to do actual real-time measurements in an experiment
that I'm currently performing. Jay!

I'm using a Wii balance board (from the Wii fit game) to measure
changes in my subjects' centre of gravity.

The Wii Balance Board connects through bluetooth to my laptop. Using
the programs GlovePIE (http://carl.kenner.googlepages.com/
glovepie_download) and PPJoy (http://www.geocities.com/deonvdw/Docs/
PPJoyMain.htm) and a small script I wrote for GlovePIE this is
converted to a virtual Windows joystick X,Y values which can be read
directly and easily using Mathematica's ControllerState function.

This gets me about 400 samples per second. A real-time plot of the
user's motions reduces it to about 20 Hz. Still not bad at all, and
very useful. Works for the Wiimote (acceleration sensors!) as well.

Cheers - Sjoerd

jjmc

unread,
Apr 16, 2009, 4:18:53 AM4/16/09
to
On Apr 15, 1:58 am, "Sjoerd C. de Vries" <sjoerd.c.devr...@gmail.com>
wrote:

This is excellent! Thanks for sharing the links.

Anyone else find it a little limiting that one needs to virtualize
devices to a "joystick" before Mathematica can access it through
controller-state? Perhaps I've been looking in the wrong places,
but I'd very much appreciate documentation towards writing new Mathematica
drivers for unrecognized controllers.

Barring that, anyone familiar with similar joystick virtualization
under mac os X?

Best, JJ

Sjoerd C. de Vries

unread,
Apr 17, 2009, 4:27:42 AM4/17/09
to
Mathematica actually finds and reads quite a variety of controllers
automatically (probably through the standard Windows game controller
and HID APIs). This ranges from my son's gamepad to my tabletPC pen. I
think you shouldn't be looking for Mathematica drivers but for the
standard Windows drivers.

Cheers -- Sjoerd

On Apr 16, 10:18 am, jjmc <superfancyawes...@gmail.com> wrote:

> Anyone else find it a little limiting that one needs to virtualize
> devices to a "joystick" before Mathematica can access it through
> controller-state? Perhaps I've been looking in the wrong places,

> but I'd very much appreciate documentation towards writing new Mathematic=
a

jjmc

unread,
Apr 18, 2009, 3:36:50 AM4/18/09
to

Hi Sjoerd,

Just to clarify, while I have no doubt that Mathematica is incredible
at recognizing all sorts of devices, it would be nice to have
documentation on how to get Mathematica's ControllerState to recognize
devices that Mathematica doesn't out of the box. I assume this would
require the device driver to implement a particular (standard?)
protocol, and possibly a new controller to be defined within
mathematica.

It seems likely that Mathematica assumes some standard protocol that
any input devices should implement. It would be nice to know what
that protocol is: i.e. I'd love to see a statement Mathematica that
will recognize any devices that implement the **** protocol. This
way, when I build a fancy new input device, I can ensure that
Mathematica will recognize it.

You needed to virtualize the wiiboard as a joystick. This is a fine
and a wonderful hack, but it what would an open-source wiiboard
windows driver had to know to do, such that Mathematica could
recognize it as a device in and of itself? I haven't really seen any
documentation on this.

Best, -JJ

David Bailey

unread,
Apr 18, 2009, 3:37:53 AM4/18/09
to
Does your joystick come with a Java driver - if it does, it would be
easy to interface that to Mathematica via J/Link.

David Bailey
http://www.dbaileyconsultancy.co.uk

ragfield

unread,
Apr 19, 2009, 4:51:11 AM4/19/09
to
On Apr 18, 2:36 am, jjmc <superfancyawes...@gmail.com> wrote:
> It seems likely that Mathematica assumes some standard protocol that
> any input devices should implement. It would be nice to know what
> that protocol is: i.e. I'd love to see a statement Mathematica that
> will recognize any devices that implement the **** protocol. This
> way, when I build a fancy new input device, I can ensure that
> Mathematica will recognize it.

Here are the categories of devices supported by Mathematica
(ControllerState/Maniuplate/Graphics3D) v6-v7:

Mac OS X:
* "Mac OS X Human Interface Device" (including "3Dconnexion 6 DOF
Device")
* "Mac OS X Motion Sensor Device"
* "SensAble Haptic Device" (PowerPC only)
* "MIDI Device" (v7+)

Windows:
* "Windows DirectInput Device"
* "Windows XInput Device"
* "3Dconnexion 6 DOF Device"
* "SensAble Haptic Device"

Linux:
* "Linux Joystick Device" (/dev/js*)
* "SensAble Haptic Device"

-Rob

0 new messages