Questions tagged [cmmotionmanager]

Use for questions regarding CMMotionManager objects; an NSObject class in the Core Motion framework and MonoTouch.CoreMotion Namespace.

CMMotionManager is an NSObject class in the Core Motion framework and MonoTouch.CoreMotion Namespace.

A CMMotionManager instance provides access to motion services and data, including accelerometer and magnetometer data.

Motion services are not available on all devices -- the deviceMotionAvailable boolean property indicates whether or not motion services are available.

Resources

152 questions
0
votes
1 answer

Get heading from RotationMatrix in iOS

I receive the RotationMatrix from my CMMotionManager and want to calculate my phone's heading from it, e.g. 38 degrees North (and avoid CLLocationManager), in order to make a more accurate compass: [motionManager…
0
votes
1 answer

fatal error: unexpectedly found nil while unwrapping an Optional value CMMotionManager

Trying to implement this raywenderlich tutiorial in swift , but unfortunately I am fatal error: unexpectedly found nil while unwrapping an Optional value on line let acceleration :CMAcceleration =…
Ali
  • 10,774
  • 10
  • 56
  • 83
0
votes
1 answer

Measuring tilt with left, right, forward and backward in ios

I want to find tilt in all side (left, right, forward, backward) I have use below code to find left and right [motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMDeviceMotion *deviceMotion, NSError *error) …
Rajesh
  • 359
  • 3
  • 14
0
votes
0 answers

iOS attitude.roll returning random numbers

I am using Xcode 6.1 and extracting the Pitch and Roll of the phone in the time honoured fashion: valuePitch = degrees(attitude.pitch); valueRoll = degrees(attitude.roll); with #define degrees(x) (180*x/M_PI) The Pitch returns the correct values.…
Edward Hasted
  • 3,201
  • 8
  • 30
  • 48
0
votes
1 answer

unable to implement CMMotionManager with ios app

I'm trying to change the UILabel value if we tilt the device, for that i'm trying to implement CMMotionManager but its not working for me, this the code I'm using, I have add CoreMotion in lib. #import CMMotionManager…
Rajesh
  • 359
  • 3
  • 14
0
votes
2 answers

Augment Reality app on IOS

I'm trying to write an augment reality app for iOS tablet. For this I use AVFoundation classes to translate video from camera to screen. The augment objects are simple UILabels "flying in the air". It must look like the labels are in front of you…
0
votes
1 answer

What is the Android equivalent of iOS's XArbitraryZVertical

In iOS, when setting up the motion sensors, a developer can pass in an initialization setting (XArbitraryZVertical) that, essentially, zeros out all of the data from the sensors in it's current position. I am wonder if there is an Android…
0
votes
2 answers

How do I adjust CMMotionManager data for orientation under iOS 8?

My application uses CMMotionManager to track device motion, but iOS always returns device motion data in the standard device orientation (home button at the bottom). To get the motion data into the same orientation as my UIView, I accumulate the…
John Stephen
  • 7,625
  • 2
  • 31
  • 45
0
votes
1 answer

How do you tell which way up the iPhone is?

Using the CMAttitude* information from an iPhone you can tell the pitch. It the iPhone is vertical it's 90º. If it's flat it's 0º. But I have an app that need to know if the iPhone is facing up or down/forwards or backwards. Any idea if this can be…
Edward Hasted
  • 3,201
  • 8
  • 30
  • 48
0
votes
1 answer

Differences between using AccelerometerData and gyroData to get phone absolute rotation?

I'm getting the phone absolute rotation (minus the z-axis) using the phone accelerometer with something like this: motionManager.startAccelerometerUpdates() ... if let data = motionManager.accelerometerData { let x = data.acceleration.x let…
lisovaccaro
  • 32,502
  • 98
  • 258
  • 410
0
votes
2 answers

Objective C / iOS - Update array from device motion pitch value

New to the site and Obj C. Attempting to get a pitch value from Device Motion (working), put into an array with the most recent 60 values (not working) and select the maximum value within the array. With each new pitch value from the device, new…
dkwill
  • 11
  • 2
0
votes
1 answer

Move SKSpriteNode with CoreMotion

I have a SKSpriteNode that represents the user and I'd like this node gets move with the user movement, if the user walks then the node moves in the same direction. The start position is the center of the view and I think it's possible to make this…
0
votes
0 answers

Delay in receiving device motion updates from CMMotionManager

I have an app with a view that, when loaded, gets regular device motion updates (20 per second) and uses them to display things on the screen. This was working fine using the old (deprecated) UIAccelerometer code. I have since ported it to use Core…
DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
0
votes
1 answer

CMMotionManager: Device Calibration does not work on a real device

I've a strange behavior with CMMotionManager. I try to calibrate the position of my device to enable my App to support multiple device orientations. When I debug my App on a real device (not in Simulator), everything is working fine. When I run the…
Stefan
  • 5,203
  • 8
  • 27
  • 51
0
votes
0 answers

Find distance using accleremoter, gyroscope and Device motion and also use double integration

I want to calculate the distance from one point to another point, when I start capturing accelerometer data, and till I stop that, it should gather all samples and should give me distance based on velocity, roll, pitch, yaw and displacement. I have…
Dipen
  • 268
  • 1
  • 14