This page is a comprehensive documentation of the coordinate systems used by Sensor Logger. Should you notice any error, please report by making an Issue or making a pull request directly. Additional information about sensors and measurements is available in-app by tapping the "eye" icon next to each sensor.
For information about units, refer to https://github.com/tszheichoi/awesome-sensor-logger/blob/main/UNITS.md
Acceleration is reported in the following coordinate system, with x
and y
being the horizontal and vertical axes of the screen and z
pointing into/out of the screen. These axes "stick" to the device, so they never change even when the phone rotates.
This is what the coordinate frames look like by operating systems.
![Screenshot 2024-02-24 at 00 57 04](https://private-user-images.githubusercontent.com/30114997/307483092-ec93559b-5443-48a1-85e0-7c05fde6b723.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTA5NzMsIm5iZiI6MTczOTI5MDY3MywicGF0aCI6Ii8zMDExNDk5Ny8zMDc0ODMwOTItZWM5MzU1OWItNTQ0My00OGExLTg1ZTAtN2MwNWZkZTZiNzIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MTc1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwNjZjOTk1YTA2OWRmYzYyMTE3MGY3M2NjZjAxYjZlZDBhNmJiOTJmOWJiNzZmNGI0Mjg4OTUwZGM1ZWJjMGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9Q7U3VXNdPIBRNdydds-IKsvs_bVXIFPsdwh0DRCjGs)
IMPORTANT: These diagrams show the direction of the applied force. This is different to the diagrams on Apple's official documentation, which shows the inertial force (exact opposite). https://developer.apple.com/documentation/coremotion/cmheadphonemotionmanager.
While the directions of the axes are the same across platforms, there is a negative sign difference for all three axes between iOS and Android. For example, if you move your phone to the right, along the x
axis, you will register positive values on Android, but negative values on iOS. This is simply a difference in definition -- likely because iOS' convention is in the context of inertial force, whereas Android's convention is in the context of accelerating force.
Accordingly, the Gravity sensor is also different by a negative sign between iOS and Android. When you place your phone flat on a table, the gravity vector points in -z
on iOS and +z
on Android.
💡: New in Version 1.29: Toggling Standardise Units & Frames under Settings > Sensor Configuration will eliminate this difference by automatically converting values logged on iOS to the Android convention. See this for more information.
Acceleration data from the Apple Watch follows the same convention as the iPhone. The acceleration values from the Headphone motion sensor follow the following convention.
![](https://private-user-images.githubusercontent.com/30114997/307468015-bf2600df-d624-4cb3-acd2-44ef633628f5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTA5NzMsIm5iZiI6MTczOTI5MDY3MywicGF0aCI6Ii8zMDExNDk5Ny8zMDc0NjgwMTUtYmYyNjAwZGYtZDYyNC00Y2IzLWFjZDItNDRlZjYzMzYyOGY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MTc1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUzOTFjYzljOThkODg4ZTFhMTE2MDc5OGFhNzBiZjBjMjM4YTk1MTE4NWMwNGZhOTczOGU0ZjA0YjBiNzY2MTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SFWT21INeLhgfQyXdERNuhYGoTHbJxrdpE08SuX5n-A)
Source: https://developer.apple.com/documentation/coremotion/cmheadphonemotionmanager
This photo below roughly aligns the coordinates for all three Apple devices. The coordinate system across the three pictured devices is always the same and consistent. As such, it is safe to compare and perform data fusion amongst measurements from these devices. However, they collectively are inconsistent with Android's coordinate system, as noted in the previous section. Toggling "Standardise Units & Frames" under Settings > Sensor Configuration will convert all measurements from Apple Watch and AirPods to Android's convention. Also note that the units of acceleration vary across iPhone, Apple Watch and AirPods if "Standardise Units & Frames" is not toggled on.
![Screenshot 2024-03-07 at 00 39 40](https://private-user-images.githubusercontent.com/30114997/310708144-ce79333d-75f5-4b83-a8fd-3c87c15222dd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTA5NzMsIm5iZiI6MTczOTI5MDY3MywicGF0aCI6Ii8zMDExNDk5Ny8zMTA3MDgxNDQtY2U3OTMzM2QtNzVmNS00YjgzLWE4ZmQtM2M4N2MxNTIyMmRkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MTc1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1MTllZmJjYTFiYTQxYWY1NTU4MDQ0MzlkOGM1NzdjOGRkOGU4M2QzOGY2MGU2MzkyYjkyYWQzZTgyMjIwMmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.s5DbRalCQb23J7STT1iAehXRhNxNTBy0PUKmNwiTIIc)
This plot compares the units and coordinate system of acceleration data from all three Apple devices with "Standardise Units & Frames" toggled on (Note: "Standardise Units & Frames" is off by default).
![Screenshot 2024-03-07 at 00 34 38](https://private-user-images.githubusercontent.com/30114997/310708875-1cd383f6-4227-4fd8-8fcd-c54288476214.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTA5NzMsIm5iZiI6MTczOTI5MDY3MywicGF0aCI6Ii8zMDExNDk5Ny8zMTA3MDg4NzUtMWNkMzgzZjYtNDIyNy00ZmQ4LThmY2QtYzU0Mjg4NDc2MjE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MTc1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwMWYyYzM4NDEzZmU3MGU4NTI2MDM5MTFjOTMyNTQ1OWQ5ZGY2OGY1ZDVhOWVhMDc2NGI0MWNmMjdkOGFhZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LseiyBE3XYp2GXxR1ukv6nA_BiDrZ5f6bHiuVjs0n5E)
The rotation rates and orientation are measured around the same axes as acceleration. When you read off the Gyroscope sensor in Sensor Logger, refer to the diagram below.
![](https://private-user-images.githubusercontent.com/30114997/307468772-ac11f346-2c49-40f1-a5e0-4c711ab978f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTA5NzMsIm5iZiI6MTczOTI5MDY3MywicGF0aCI6Ii8zMDExNDk5Ny8zMDc0Njg3NzItYWMxMWYzNDYtMmM0OS00MGYxLWE1ZTAtNGM3MTFhYjk3OGYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE2MTc1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRjZDBkNGMwNzgzMjMwZTAyMzJiMGMzNjFlMzIxMjg0ZTZkYzgxNjExY2MyNWE5MGEyYjNkNGRjZmU4OWM1MmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0ykxfXm1EfnrJj2g7I-WpFbulyKlDjXTXE1NR0fAHSE)
Source: https://developer.apple.com/documentation/coremotion/getting_raw_gyroscope_events
For the rotation rate readings from the Gyroscope sensor, iOS and Android have consistent definitions.
The orientation is derived from the rotation rate and references the same axes. To be specific:
roll
refers to the rotation aroundy
;pitch
refers to the rotation aroundx
;yaw
refers to the rotation aroundz
. Sometimes also called theazimuth
.
Additionally, orientation has an arbitrary offset, as it is an integrated value from the rotation rate (i.e. an integration constant). For this, Sensor Logger uses the x-north-z-vertical
reference frame, meaning the yaw
value is 0 when the x
axis is aligned with the north (i.e. the angle between the device's y
axis and the north).
Due to legacy reasons and backwards compatibility reasons, there are some key differences in interpreting the yaw value:
- On iOS, north means the true north, whereas on Android, it refers to the magnetic north. You may have to account for this difference if you are comparing absolute values measured across platforms, though factors such as the accuracy of the magnetometer may outweigh such differences.
- On iOS,
yaw
increases when you turn counterclockwise around thez
axis (as pictured above). On Android,yaw
increases when you turn clockwise around thez
axis (opposite to pictured above, i.e. east is +π/2 and west is -π/2). - On iOS,
pitch
decreases as you rotate around thex
axis clockwise. On Android,pitch
decreases as you rotate around thex
axis counterclockwise (i.e. tiling the phone's top edge towards you and the phone's bottom edge away from you when you hold your phone normally)
Further, on Android, there are additional Orientations you can log with various trade-offs. See https://github.com/tszheichoi/awesome-sensor-logger/blob/main/ORIENTATION.md.
💡: New in Version 1.29: Toggling Standardise Units & Frames under Settings > Sensor Configuration will eliminate 1 and 2 by automatically converting values logged on iOS to the Android convention. See this for more information.