Optofidelity: PWM-proof StateChangeDetector
The state change detector is the most challenging to make work with
PWM artifacts. There are two major issues:
- During the detection of the finger, the PWM causes reflections off
the robot finger. This is solved by averaging over multiple frames.
- The resulting data is very noisy, but still shows distinct states.
We apply a low pass filter (which does not add latency to the result,
since it's using both a-priori and a-posteriori data for averaging.)
and normalize the states to the average level of each state.
TEST=unit tests included. covered by regression tests on the S6 Edege
and Nexus 6.
Commit-Ready: Dennis Kempin <firstname.lastname@example.org>
Tested-by: Dennis Kempin <email@example.com>
Reviewed-by: Dennis Kempin <firstname.lastname@example.org>
4 files changed