Adding in the nonlinearity processing scripts
For the non-linearity compensation filter to work we need to be able to
process the many many logs that are recorded to build up the lookup
table that is later used to adjust positions as they come in. These
scripts have been in flux and now have somewhat stabilized so I'm
committing them to the touchbot project for future use.
parse.py --> Parses a collection of activity_logs and saves "strokes" to
disk which are pickled lists of (x, y, p) tuples each corresponding to a
single continuous line drawn on the Touchpad
showPath.py --> Loads pre-parsed stroke.p files, and plots their
coordinates using matplot lib to see what the pattern of the strokes
was. Very useful for debugging
progress --> When you're doing these with real data it can take quite a
bit of time to load the thousands of points and do all the processing.
This progress bar class is just for the ease of use of the operator
stroke --> Class representing a single continuous line on the touchpad.
It is essentially a list of (x, y, p) points with a few helper functions
to allow us to manipulate the strokes better
General usage:
You'll have a whole bunch of activity_log1.txt, activity_log2.txt, ...
python parse.py activity_log*.txt
This generates stroke1.p, stroke2.p, ... stroke2134.p
python showPath.py stroke*.p
This loads all the stroke.p files and displays them to the screen so you
can visualize the logs.
At this point, you know you have legit stroke*.p files and can use other
scripts to anylize them further and will be added later, but for the
sake of incrementally merging these in, I'm just starting with the basic
functionality
BUG=chromium:233579
TEST=manual testing as described in the commit msg using data collected
off a real system
Change-Id: I857781ed03af645412728651bbe27218fb051aba
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57517
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
5 files changed