From 1ce0c3a26f45a21da557c171d703aecea5d2a239 Mon Sep 17 00:00:00 2001 From: John Poole Date: Fri, 17 Apr 2026 08:49:44 -0700 Subject: [PATCH] Added coordinate map. --- exercises/21_six_axis/Discussion.md | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/exercises/21_six_axis/Discussion.md b/exercises/21_six_axis/Discussion.md index 6d8b5e2..45858aa 100644 --- a/exercises/21_six_axis/Discussion.md +++ b/exercises/21_six_axis/Discussion.md @@ -54,7 +54,7 @@ Az = -0.003 Device standing upright (antenna vertical) -Upright Orientation +Upright Orientation Measured accelerometer values: @@ -164,6 +164,39 @@ While raw values differ between orientations: - Results are consistent regardless of startup pose --- +### 4. Coordinate Mapping + +From the observed accelerometer data: + +- Upright orientation: +Y_sensor ≈ UP +- Sideways orientation: -X_sensor ≈ UP (after 90° rotation) + +We define a **device coordinate system** aligned with the AlleyCat enclosure: + +- Z_device = UP (antenna direction) +- Y_device = FORWARD (normal to display, pointing outward) +- X_device = RIGHT (along the long axis of the display) + +Mapping from sensor frame to device frame: + + Z_device = +Y_sensor + +The remaining axes are determined by physical orientation and require sign validation: + + X_device ≈ +Z_sensor + Y_device ≈ ±X_sensor + +Final sign conventions should be verified empirically by observing motion: + +- Rotate device forward/back → affects Y_device +- Rotate device left/right → affects X_device + +This mapping separates: + +- Sensor frame (hardware-defined) +- Device frame (application-defined) + +and provides a consistent basis for roll, pitch, and future magnetometer integration. ## Sources of Error