What exactly does the iPhone accelerometer measure?
The apple documentation for UIAcceleration class says,
“When a device is laying still with its back on a horizontal surface, each acceleration event has approximately the following values:
SceneKit : SCNPhysicsBody get current velocity SKPhysicsBody avoid collision Swift/SpriteKit SKSpriteKit maintaining constant velocity after collision Moving Node on top of a moving platform Make a Vortex in Box2D applyForce(0, 400) - SpriteKit inconsistency
Now, I am confused! How can the acceleration be non-zero, when you clearly say the “device is laying still”?
Judging by the responses, I think this should be called something like ‘forceometer’ or ‘gravitometer’ and not accelerometer!
- iOS 7 Sprite Kit freeing up memory
- SKSpriteKit maintaining constant velocity after collision
- Not a number error (NAN) doing collision detection in an iphone app
- SKPhysicsBody avoid collision Swift/SpriteKit
- Moving Node on top of a moving platform
- Calculate correct impluse or force to move a Box2D body to a specific position - Box2D
6 Solutions Collect From Internet About “What exactly does the iPhone accelerometer measure?”
You get a -1 on the Z axis because gravity is acting on the device, applying a constant acceleration of 1G. I assume you want user acceleration, which you can get from the DeviceMotion object using a device motion handler as opposed to an acceleration handler. The
userAcceleration property filters out the effects of gravity on the device and only gives you how much the user is accelerating it.
I found the answer [in the CoreMotion Reference guide, thanks to bensnider:
The accelerometer measures the sum of two acceleration vectors: gravity and user acceleration. User acceleration is the acceleration that the user imparts to the device.
You’ll find the best answers in datasheet of the accelerometer used (LIS302DL).
It measures the gravity. The unit is chosen so that the gravity, 9.81 m/s^2, equals 1 unit. The sign tells how the phone axis is directed. In other words, what the phone considers downwards.
The phone measures 0 as acceleration in free fall. I don’t know how much you want to throw your phone up and down to test it 🙂
When you’re sitting, gravity is pulling you down to your chair. If it weren’t for the chair or ground for that matter, you’d be falling down with acceleration of about 9.8m/s^2. In order for the chair to prevent you from falling down, it has to act with a force in the opposite direction with at least the same value.
The accelometer shows the value of the pulling force and it’s a three-dimensional vector. In this case it’s directed straight down. And the value given is expressed in
G, units of gravity acceleration multiplied by that value.
Answerers keep missing the right wording that should set it straight for you… The device is “laying still” only relatively to you. It is actually not laying still at all. The http://en.wikipedia.org/wiki/Centripetal_force of gravity gives it (and you) centripetal acceleration. It is real, it is what keeps you from flying off Earth on a tangent, and it is what the accelerometer dutifully shows. (Earth is nothing special – we rotate about the Sun also etc etc, whose centripetal accelerations are way smaller, but they would be all shown by an accelerometer sensitive enough.)
- Download all available (and new) files
- Class variables not yet supported
- How do I create a page flip effect programmatically?
- Swift JSON parsing with Dictionary with Array of Dictionaries
- iOS: get video duration and thumbnails without playing video
- What to use if not “IPHONE UDID”?
- How to manage data between the entities with the UIPICKERVIEW?
- Delegate not getting set
- xcode iphone simulator view smaller than storyboard
- Search and highlight text in PDF rendered in UIView
- Problems building for both iOS4.3 and iOS5.0
- How to use navigationController to show up a WebView when I choose one cell from the tableView?
- How to handle native iOS Alerts in Appium using Java
- improper advertising identifier usage
- Class type Objective C