diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-02-19 14:44:01 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-03-01 02:35:59 +0000 |
commit | 2356c3e2130b24ba9a4eddfa93de721c3686907c (patch) | |
tree | cb5ba1d77efef8478c12b63ebd952cbbfdc209e5 /board/host | |
parent | cb8cfec66c19417f776f776fbc3698284e3fcf65 (diff) | |
download | chrome-ec-2356c3e2130b24ba9a4eddfa93de721c3686907c.tar.gz |
rambi: Rotate accelerometer data into standard reference frame
Added rotation of accelerometer data into a standard reference frame
so that the host does not have to know about the orientation of the
sensors.
Also added a calibration routine to calibrate the rotation matrix to
get to the standard reference frame. Cleanup up calibration in the
process to make it more user friendly.
Changed the default accelerometer sampling rate to 100Hz.
BUG=chrome-os-partner:25599
BRANCH=rambi
TEST=Tested the full calibration routine on a glimmer at my desk.
Used 'taskinfo' and verified that the higher sampling rate does not
bog down the EC. I found that the motion sense task is running for
about 200ms every 10 seconds, so about 2% CPU load.
Change-Id: I9ca1a4252f62a54016009c7d5e43b4cb1adf7e1d
Original-Change-Id: Id554511f7cc9549dfc9ed2d6337216bfa639359d
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/187172
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/188385
Diffstat (limited to 'board/host')
-rw-r--r-- | board/host/board.c | 5 | ||||
-rw-r--r-- | board/host/board.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/board/host/board.c b/board/host/board.c index daf78d8cb9..1d9ab77c23 100644 --- a/board/host/board.c +++ b/board/host/board.c @@ -84,6 +84,11 @@ const struct accel_orientation acc_orient = { { 0, 1, 0}, { 0, 0, -1} }, + .rot_standard_ref = { + { 1, 0, 0}, + { 0, 1, 0}, + { 0, 0, 1} + }, .hinge_axis = {0, 1, 0}, }; diff --git a/board/host/board.h b/board/host/board.h index 55d66afb7b..130bdcd385 100644 --- a/board/host/board.h +++ b/board/host/board.h @@ -9,6 +9,7 @@ #define __BOARD_H /* Optional features */ +#undef CONFIG_ACCEL_CALIBRATE #define CONFIG_EXTPOWER_GPIO #undef CONFIG_FMAP #define CONFIG_POWER_BUTTON |