Add robot support for one-finger tap tests
This add robot support to the gesture interpreter for
one-finger tap tests.
BUG=chromium:474709
TEST=manually tested
Change-Id: I41b63c5ee43ce7c541e9c88c8654c3379e8bb5d3
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/267777
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
diff --git a/gesture_interpreter.py b/gesture_interpreter.py
index 71ac01d..92a25f4 100644
--- a/gesture_interpreter.py
+++ b/gesture_interpreter.py
@@ -77,6 +77,8 @@
fn = None
if test.name == tests.NOISE_STATIONARY:
fn = lambda: _PerformStationaryNoiseTest(variation, robot, device_spec)
+ elif test.name == tests.ONE_FINGER_TAP:
+ fn = lambda: _PerformOneFingerTapTest(variation, robot, device_spec)
elif test.name in SINGLE_FINGER_LINE_TESTS:
pause = 1 if test.name == tests.ONE_FINGER_TRACKING_FROM_CENTER else 0
fn = lambda: _PerformOneFingerLineTest(variation, robot, device_spec, pause)
@@ -95,6 +97,13 @@
robot.SingleTipTap(device_spec, fingertip, tap_position, touch_time_s=4)
+def _PerformOneFingerTapTest(variation, robot, device_spec):
+ location, = variation
+ tap_position = LOCATION_COORDINATES[location]
+ fingertip = robot.fingertips[STANDARD_FINGERTIP]
+ robot.SingleTipTap(device_spec, fingertip, tap_position)
+
+
def _PerformOneFingerLineTest(variation, robot, device_spec, pause_time_s):
direction, speed = variation
start, end = LINE_DIRECTION_COORDINATES[direction]