|
This change implements the hybrid accelerometer calibration
algorithm described in
https://drive.google.com/corp/drive/u/0/folders/13k8AWvVkCg8KUr1HhD2qv6_ob1ixgCbE
1. Waits until the device is still
2. Adds a still sample to an orientation accumulator
- If the new sample is close to an existing one, they're
merged.
- If the new sample is unique, it is added to the list of
orientations in a FIFO manner (may be evicting an older
sample).
- Once enough orientations have been gathered, run the
kasa algorithm.
- The kasa algorithm should yield a radius that's near 1g,
since all the samples were added when still. If this isn't
the case, we fall back on newton's method (which takes
longer).
BUG=b:138303429,chromium:1023858
BRANCH=None
TEST=buildall with new unit tests
Change-Id: I98bb0d365017d8a916b008c7c0c263345a9cddac
Signed-off-by: Yuval Peress <peress@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879716
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
|