[ml] quantizer test harness

Michael C. Toren mct at toren.net
Fri Aug 28 06:44:30 UTC 2009


I spent some time today modifying Gesture.java and Quantizer.java such
that we can build and run them without a WiimoteAccelerationEvent class.
For example, I took instances of things like
"Vector<WiimoteAccelerationEvent> data", and transformed them into
"Vector<double[]> data".  I then replaced calls to things like "getX()",
"getY(), and "getZ()" with "[0]", "[1]", "[2]", etc.  I'm not a java
person, so if someone with more java experience can diff these changes
against the upstream wiigee package to ensure they're sane, that'd be
great.  I checked my versions into the wiigee-c/javatest/logic directory.

Using these modified classes, I then kludged together
wiigee-c/javatest/TestHarness.java.  It reads a list of coordinates from
stdin, builds up a Gesture class, runs them through Quantizer, and prints
the data returned by Quantizer.getObservationSequence().  I modified
wiigee-c/main.c similarly.  So, if you have a file with a list of
coordinates, you can now run them through both the wiigee Java source and
through our C port to confirm the output is identical.

Unfortunately, the output is far from identical at the moment :/  I
created three coordinate test files, wiigee-c/test_data/increment.dat,
zeros.dat, and repeated.dat.  The first two are returning the wrong number
of elements (8, which happens to be the number of states, rather than 20,
the number of coordinates in the data file), which hopefully is an easy
bug to correct.  The third file appears to cause the program to enter an
infinite loop, which is more annoying.

So, we have some work to do.  But, at least we have some metrics to see
how far along -- and how correct -- we are.

-mct



More information about the ml mailing list