Refresh rate: 10 Hz for 60 s – keep the device steady or shake it, and watch the console.
What you just saw
acceleration
is already gravity-compensated (if available). When the sensor cannot remove gravity, only the accelerationIncludingGravity
key shows up—and the spec tells you what you must expect.rotationRate
(alpha,beta,gamma
°/s) maps directly to the gyro reading.webkitCompassHeading
comes from fusion of the magnetometer and optionally the gyro; resolution depends on calibration status. If you need raw mag, DeviceMotionEvent.magnetometer
is missing on iOS.16
ms). It drops to 30 Hz with power-saving enabled.HPR take-aways for your project
Heading ≈webkitCompassHeading
Pitch =- e.beta
(degrees, device-orientation event) Roll =- e.gamma
Heave/vertical acceleration =e.acceleration.z
when phone is mounted vertical, bow forward.
Need raw magnetometer? At the moment iOS only exposes the fused heading, not μT components. You could obtain them with a native Swift app instead: CMMotionManager.magnetometerData
.