I see some unexpected readings from the userAcceleration field in CMDeviceMotion. When I look at the raw accelerometer data from CMAccelerometerData, I see that if the iPhone is flat on the table, then reading is 1G down (1G in the Z axis), and if I reset the iphone (on a soft surface, of course), then the accelerator’s reading zero as expected. This is all wonderful. When I use the CMDeviceMotion class instead, the userAcceleration reading is zero as expected when the iPhone is flat on the table. Again, this is wonderful. But when I drop the iPhone and read the CMDeviceManager user control, the userAcceleration values are 1G (+ Z), not down (-Z), as expected. It seems that the userAcceleration readings are actually the exact opposite of what kind of acceleration the device actually experiences. Has anyone else noticed this? Can I just invert (multiply by -1) all userAcceleration values before trying to integrate for speed and position, or I don’t understand what userAcceleration is reading?
Marc source share