0

I want to get whether iPhone device is stationary, walking, In car etc.

Can I get it through Core Motion Framework?

CMAcceleration only gives x, y and z values.

How to use this value to calcluate iPhone Device Activity

Bhumeshwer katre
  • 4,671
  • 2
  • 19
  • 29

1 Answers1

1

An accelerometer measures acceleration (change in velocity).

Those values are acceleration in the X, Y, and Z directions. If the phone is stationary (or traveling at a constant velocity) then those values will be ~zero.

How can I find the velocity using accelerometers only?

Community
  • 1
  • 1
Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
  • Thanks for reply. But when I am walking or I am in the car still acceleration values not changing drastically. Even when my phone is on the table acceleration values are changing with same rate as when I am walking or in a car. – Bhumeshwer katre Oct 10 '13 at 08:40
  • @Bhumeshwerkatre Exactly. Because when you are moving in a car, you are traveling at a relatively constant velocity. Change in velocity over time (`dv/dt`) is ~= 0. Just as if you were sitting still. It's an accelerometer, not a velocimeter. – Jonathon Reinhart Oct 10 '13 at 08:45
  • What you can do, is assume an initial velocity of zero, and then perform a continuous integration of the acceleration over time, to keep an estimated velocity. Understand though, that the device has no way of actually knowing the velocity (aside from GPS, etc.) – Jonathon Reinhart Oct 10 '13 at 08:47
  • It just dawned on me that a moving [RMS](http://en.wikipedia.org/wiki/Root_mean_square) of the acceleration may provide the kind of "activity" or general movement information you are looking for. Basically this would pick up more back-and-forth type movement. – Jonathon Reinhart Oct 10 '13 at 08:49
  • iOS 7 providing CMMotionActivity framework to get device state stationary, walking, running, automotive, unknown, property. I want to achieve this for iOS 6. So I thought to do with CoreMotion. – Bhumeshwer katre Oct 10 '13 at 08:55