Add device measuring to TouchbotII's device.py

There is a problem with some of the tests in the touch FW suite where
the spec calls for fingers to be an absolute distance apart. (eg: draw a
line with two fingers 10cm apart)  This is impossible currently due to
the fact that all the robot commands use a relative coordinate system.
That allows the gestures to all scale really well, but means you can't
be sure how many mm apart they are.

This CL adds some functionality to the pre-existing device.py script for
TouchbotII to compute the actual (mm) dimensions of a device spec.  You
can simply run the device.py script now and it'll load your spec and
tell you how high and wide the pad is, which should allow the firmware
test to compute the correct relative coordinates for those few tests
that need to give absolute distances.

BUG=chromium:354593
TEST=I computed the dimensions of several device specs and it seemed
correct and functional.

Change-Id: Ie4ca4211295c1ce3b9ff863c3a2a49a5304c085c
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192901
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
1 file changed