Add in a squareness test
This CL adds a "squareness" test to the firmware test suite.
Essentially, we've seen a few firmwares for touch devices come in
that don't have a squared resolution. eg: movement is compressed
in x or y. When this happens if you draw a 45 degree line on the
pad, the height and width will not be exactly the same, and it will
have a distorted angle..
This test has the robot/operator draw a 45 deg line on the pad,
then looks at the angle formed by these points. It should be right
about 45 if the resolution is correct.
BUG=none
TEST=manually tested.
Change-Id: Id7536c7371418d622684b3b8f67d1d43376d5554
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/326470
diff --git a/gesture_interpreter.py b/gesture_interpreter.py
index 76f9711..6fbd3f0 100644
--- a/gesture_interpreter.py
+++ b/gesture_interpreter.py
@@ -222,6 +222,9 @@
elif test.name == tests.DRAG_THUMB_EDGE:
fn = lambda: _PerformThumbEdgeTest(variation, robot, device_spec)
+ elif test.name == tests.SQUARE_RESOLUTION:
+ fn = lambda: _PerformSquareResolutionTest(variation, robot, device_spec)
+
if fn is None:
print color.Fore.RED + 'Robot unable to perform gesture! Skipping...'
return None
@@ -336,3 +339,8 @@
robot.fingertips[STANDARD_SECONDARY_FINGERTIP]]
location = LOCATION_COORDINATES[tests.GV.CENTER]
robot.Drumroll(device_spec, fingertips, location)
+
+def _PerformSquareResolutionTest(variation, robot, device_spec):
+ fingertip = robot.fingertips[STANDARD_FINGERTIP]
+ location = LOCATION_COORDINATES[tests.GV.CENTER]
+ robot.Draw45DegreeLineSegment(device_spec, [fingertip], location)