Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMMotionActivityManager ignores cycling

I've been researching the new M7 chip's CMMotionActivityManager, for determining whether the user of the device is walking, running, in a car, etc (see Apple Documentation). This seemed like a great step forward over trying to determine this previous from using LocationManager and accelerometer data only.

I notice however that CMMotionActivityManager does not have a cycling activity, which is disappointing, and almost a deal-breaker for complete usage as a new activity manager. Has anyone else found a convenient way to use CMMotionActivityManager with cycling also without having to reincorporate CMLocationManager + accelerometer just to try to test for cycling too?

Note, this also does not include general transport options for things like a Train. For instance, I commute an hour a day on the train. Automotive could be made more generic at least, similar to how Moves uses Transport.

CMMotionActivity has these defined motion types only:

  • stationary
  • walking
  • running
  • automotive
  • unknown

Useful notes from Apple's code, that does not necessarily solve the issue, but is helpful:

CMMotionActivity

An estimate of the user's activity based on the motion of the device.

The activity is exposed as a set of properties, the properties are not mutually exclusive.

For example, if you're in a car stopped at a stop sign the state might look like: stationary = YES, walking = NO, running = NO, automotive = YES

Or a moving vehicle, stationary = NO, walking = NO, running = NO, automotive = YES

Or the device could be in motion but not walking or in a vehicle. stationary = NO, walking = NO, running = NO, automotive = NO. Note in this case all of the properties are NO.

[Direct Source: Apple iOS Framework, CoreMotion/CMMotionActivity.h @interface CMMotionActivity, inline code comments]

like image 677
Miro Avatar asked Apr 22 '14 21:04

Miro


2 Answers

First of all its your question or kind of informative details on M7?

Has anyone else found a convenient way to use CMMotionActivityManager with cycling also without having to reincorporate LocationManager + accelerometer just to try to test for cycling too?

See there is lots of confusion it will create if you want to check if activity is type of cycling ??because its just depend on accelerometer

accelerometer contain microscopic crystal structures that get stressed by accelerative forces, which causes a voltage to be generated.and from that voltage it can parse the result.. so what i know is its just classifies your speed and giving you result that its running walking or automotive so if you want to use cycling some time very fast very slow or medium so may be it will some time result in to walking or running or may be auotomotive so m7 can not clarify the thing if its automotive or cycling or running because there is not much of speed variance while you cycling.

Still while using for running and walking its some time gives wrong results in some cases.. so that will chances that your app will give wrong information too.

One more thing you asked is

Note, this also does not include general transport options for things like a Train. For instance, I commute an hour a day on the train. Automotive could be made more generic at least, similar to how Moves uses Transport.

So Apple is also working on other mapping features. Apple is said to be planning notable updates to its Maps app in iOS 8, and the company is currently working on implementing both public transit directions and indoor mapping features (which Google already has on iOS).

http://www.macrumors.com/2013/09/12/apple-working-to-leverage-new-m7-motion-sensing-chip-for-mapping-improvements/ (Useful Link)

like image 87
User 1531343 Avatar answered Oct 11 '22 14:10

User 1531343


So, not sure if you still need an answer to that but here is the latest from iOs8 SDK

@property(readonly, nonatomic) BOOL cycling NS_AVAILABLE(NA, 8_0);
like image 40
Gal Blank Avatar answered Oct 11 '22 13:10

Gal Blank