diff options
author | Yuval Peress <peress@chromium.org> | 2019-10-24 14:29:06 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-08 01:42:46 +0000 |
commit | dc77f10578a33ef0d3450623bf5a648d42606d8b (patch) | |
tree | 739da5b3a151bafecb9e9f11f919d059428e873c /test/accel_cal.tasklist | |
parent | 0fffe36e799cd7d0d0ecc7f28d01c332cdcebd57 (diff) | |
download | chrome-ec-dc77f10578a33ef0d3450623bf5a648d42606d8b.tar.gz |
common: Implement accelerometer calibration
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>
Diffstat (limited to 'test/accel_cal.tasklist')
-rw-r--r-- | test/accel_cal.tasklist | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/accel_cal.tasklist b/test/accel_cal.tasklist new file mode 100644 index 0000000000..0e3696c3f0 --- /dev/null +++ b/test/accel_cal.tasklist @@ -0,0 +1,10 @@ +/* Copyright 2019 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * See CONFIG_TASK_LIST in config.h for details. + */ +#define CONFIG_TEST_TASK_LIST \ + TASK_TEST(MOTIONSENSE, motion_sense_task, NULL, TASK_STACK_SIZE) |