Enable line-drawing noise tests for touchbot
This CL adds in the "line" noise test to compliment the existing
stationary noise tests.
In these new tests the robot will draw a diagonal line across the
touch device and run the usualy line validators on it. (Things like
checking linearity and report rate, etc) It wraps all the validators
in another that removes the first 1 second of logs to allow the
touch IC to react to the newly injected noise.
BUG=chromium:517946
TEST=manually tested using the touchbot
Change-Id: Iffe9558cedad029d0d65c3f2cf04c5be2a16f83a
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291433
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
diff --git a/gesture_interpreter.py b/gesture_interpreter.py
index 6f43b51..76f9711 100644
--- a/gesture_interpreter.py
+++ b/gesture_interpreter.py
@@ -155,6 +155,9 @@
if test.name == tests.NOISE_STATIONARY:
fn = lambda: _PerformStationaryNoiseTest(variation, robot, device_spec)
+ elif test.name == tests.NOISE_LINE:
+ fn = lambda: _PerformLineNoiseTest(variation, robot, device_spec)
+
elif test.name in ONE_FINGERTIP_TAP_TESTS:
fingertip = robot.fingertips[TAP_TEST_FINGERTIPS[test.name]]
num_taps = 20 if test.name == tests.REPEATED_TAPS else 1
@@ -232,6 +235,11 @@
fingertip = robot.fingertips[NOISE_TESTING_FINGERTIP]
robot.Tap(device_spec, [fingertip], tap_position, touch_time_s=4)
+def _PerformLineNoiseTest(variation, robot, device_spec):
+ frequency, amplitude, waveform, direction = variation
+ start, end = LINE_DIRECTION_COORDINATES[direction]
+ fingertip = robot.fingertips[NOISE_TESTING_FINGERTIP]
+ robot.Line(device_spec, [fingertip], start, end, pause_s=1, swipe=False)
def _PerformOneFingertipTapTest(variation, robot, device_spec, fingertip,
vertical_offset, num_taps):