Questions tagged [core-motion]

Core Motion is a framework within Apple's iOS SDK used to access all kind of motion sensor data. Introduced in version 4.0 it is the recommended way of accessing gyroscope or accelerometer data, and since version 5.0 magnetometer (compass) data as well.

Citing from Event Handling Guide for iOS:

Core Motion is a system framework that obtains motion data from sensors on a device and presents that data to applications for processing. The handling of the sensor data and the application of related algorithms occurs on Core Motion’s own thread. The items of hardware that detect and originate these motion events are the accelerometer and the gyroscope. (The gyroscope is currently available only on iPhone 4.) Core Motion publishes an Objective-C programmatic interface that enables applications to receive device-motion data of various types, which they can then process in appropriate ways.

Core Motion is replacing the older UIAccelerometer framework wich is still available but deprecated in version 5.x.

705 questions
10
votes
3 answers

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…
Miro
  • 5,085
  • 1
  • 33
  • 59
10
votes
1 answer

pARK working on iPhone 3GS

I have been building on top of the iphone augmented reality framework found here but sadly, on mobiles without gyro (namely the 3GS) it doesn't work (as it states.) Does anyone know of a fix to make it work with the motion sensors and compass…
Nils Munch
  • 8,670
  • 11
  • 48
  • 101
9
votes
2 answers

Strange #NullIsland warning from CoreMotion.framework

Since recently, I get in the Xcode logs a lot of strange warnings from the CoreMotion framework, related to function getLocationForBundleID: [Client] {"msg":"#NullIsland Either the latitude or longitude was exactly 0! That's highly unlikely",…
Reinhard Männer
  • 11,202
  • 4
  • 45
  • 85
9
votes
1 answer

What does CMErrorDomain error 103. mean? (CMPedometer)

I'm struggling totally to get CMPedometer to return any step data. However Iconfigure I get Error Domain=CMErrorDomain Code=103 "The operation couldn’t be completed. (CMErrorDomain error 103.)" I'm using swift and have broken down the…
Ben Walton
  • 252
  • 2
  • 9
9
votes
1 answer

iOS detect movement of user

I want to create a simple app that draws a simple line on screen when I move my phone on the Y-axis from a start point to end point, for example from point a(0,0) to point b(0, 10) please help demo :
AITAALI_ABDERRAHMANE
  • 2,358
  • 1
  • 22
  • 30
8
votes
3 answers

get pitch, yaw, roll from a CMRotationMatrix

I have a CMRotationMatrix *rot and i would like to get the pitch, yaw, roll from the matrix. Any ideas how i could do that? Thanks
Jonas Schnelli
  • 9,827
  • 3
  • 45
  • 57
8
votes
1 answer

Wrong compass heading values with CoreMotion

I'm using CoreMotion to get the ccompass heading and i noticed some problems with the compass heading. At first my initialization of CoreMotion. I got a CMMotionManager object, locationManager, which is an instance of the CMMotionManager. //…
SMP
  • 586
  • 3
  • 12
8
votes
1 answer

Do the sensor fusion algorithms of Core Motion take advantage of the Kalman filter?

Do the sensor fusion algorithms of Core Motion take advantage of the Kalman filter?
Proud Member
  • 38,700
  • 43
  • 143
  • 225
8
votes
3 answers

Get current iOS device orientation even if device's orientation locked

I want to get the current iOS device orientation even if device's orientation is locked. (Just like iOS Camera app) I want to detect Portrait, Landscape Left and Landscape Right at least. UIDeviceOrientation and UIInterfaceOrientation do not seem to…
okd
  • 83
  • 1
  • 6
8
votes
1 answer

Listening to device shake event on background mode

I'm new to iOS development, with strong background in Android. I know that Android gives developers much more control and power to do whatever they want, and it's pretty easy to listen to the accelerometer event if your app was closed a month ago. I…
Chen Kinnrot
  • 19,385
  • 15
  • 74
  • 132
8
votes
1 answer

How to be notified when the user deny fitness data?

I can check if the user authorized fitness data using -[CMMotionActivityManager queryActivityStartingFromDate:toDate:toQueue:withHandler:] and check for an error (CMErrorNotAuthorized or CMErrorMotionActivityNotAuthorized) in the handler. If the…
nverinaud
  • 1,277
  • 13
  • 25
8
votes
2 answers

Prompting permission for Motion & Fitness data

I want users to be prompted as soon as app launches for permission to access Motion & Fitness data (CoreMotion). Right now I'm trying to do a "dummy" query for the data to prompt the permission on a…
leonsas
  • 4,246
  • 6
  • 37
  • 64
8
votes
3 answers

Swift watchOS 2 - CMSensorDataList

Short: I don't know how to extract the CMRecordedAccelerometerData from the CMSensorDataList after getting one from the CMSensorRecorder. Apple isn't providing any documentation, yet. Maybe someone has a hint for me? ;) func…
Narsail
  • 443
  • 6
  • 10
8
votes
2 answers

How do I retrieve accelerometer data correctly with Swift in iOS?

I am trying to record the data from the iPhone's accelerometer (my own iPhone 5s) and set a label on the screen to that data using String(format: "%.2f", data) where data is the value for the specific axis I want to record. To do this I set up a…
user4390998
8
votes
2 answers

Using quaternion instead of roll, pitch and yaw to track device motion

Please bear with my long question, I am trying to make it as clear as possible. What i am trying to do is, get the attitude(roll pitch and yaw) when a picture is taken using camera and then save the attitude values to nsuserdefaults. After saving,…
iSeeker
  • 746
  • 1
  • 8
  • 24
1 2
3
46 47