core-motion

User Activity Static/running/Walking/Driving based on CoreMotion data only

扶醉桌前 提交于 2019-12-08 09:52:30
问题 How can we detect user is driving/walking/running/static with CoreMotion data. We can get user activity in iPhone 5s using CMMotionActivityManager. But how to get in lower version devices. With the help of CLLocationManager I can get the device speed and based on speed I can decide the user state, which drain battery life of device. Is there any possibility to detect Device State based on Core motion only? Some application like like Place me app does, It detect user activity based on

Augmented Reality App in Landscape Mode

ⅰ亾dé卋堺 提交于 2019-12-08 08:13:37
问题 I am trying to build an augmented reality app using the CoreMotion framework. I have tried to go off of Apple's pARk sample code project, but it only works in portrait mode. I need it to work in landscape. When switched to landscape mode the subviews in the overlay view move in the opposite directions and at the wrong rate (they either move too fast or too slow across screen) I have read other postings that provide two solutions: Create a reference attitude and apply the inverse of that

Update rotational data from the gyroscope with respect to a predefined orientation?

一个人想着一个人 提交于 2019-12-08 06:23:24
Normally rotational data from the gyroscope y axis is updated with respect to vertical orientation of the phone. But if this orientation slightly changes as shown in the diagram, is there any method that i could take the component of y rotation to vertical axis(Vertical orientation position of the phone), ( This is possible for linear components by using Cosine angles sine angles) But what about rotation? Anyway i can we do this? To my experience, gyroscope's values are mobile, meaning that the axis are updated as rotations intervene (that's true for Android, no reason not to be for iOS). If

Update rotational data from the gyroscope with respect to a predefined orientation?

早过忘川 提交于 2019-12-08 06:15:16
问题 Normally rotational data from the gyroscope y axis is updated with respect to vertical orientation of the phone. But if this orientation slightly changes as shown in the diagram, is there any method that i could take the component of y rotation to vertical axis(Vertical orientation position of the phone), ( This is possible for linear components by using Cosine angles sine angles) But what about rotation? Anyway i can we do this? 回答1: To my experience, gyroscope's values are mobile, meaning

Detect physical movement of iPhone/Apple Watch

℡╲_俬逩灬. 提交于 2019-12-08 02:27:14
问题 I'm trying to detect the movement (to the right or left) performed by users. We assume that the user starts with his arm extended in front of him and then moves his arm to the right or to the left (about 90 degrees off center). I've integrated CMMotionManager and want to understand detecting direction via startAccelerometerUpdatesToQueue and startDeviceMotionUpdatesToQueue methods. Can anyone suggest how to implement this logic on an iPhone and then on an Apple Watch? 回答1: Apple provides

iOS core motion detect forard / backward tilt

你。 提交于 2019-12-08 01:30:18
问题 I am using the iOS core motion framework to detect if the device is tilted forward or backwards. See image for details: http://i.stack.imgur.com/2Ojw5.jpg Using the pitch value a can detect this movement but I can not distinguish between forward AND backward. More details: I try to detect if there is a movement (tilting forward and backward) in either the forward area OR backward area (see updated sketch). The problem with the pitch is that it starts with a value of about 1.6 if the device is

Push method for core motion and frequency of Accelerometer/Gyroscope Data

本秂侑毒 提交于 2019-12-08 01:03:47
问题 When push method is used to get accelerometer/gyroscope/device motion data, unfortunately the gyroscope and the device motion maximum frequency cannot exceed 72Hz on average (in fact the data is not periodic at all either). Even worse, if only the gyroscope data is recorded (without starting device motion update service: i.e. using only [motionManager startGyroUpdatesToQueue:opQ withHandler:gyroHandler]), then the gyroscope data frequency drops to 52Hz on average. Has anyone tried to obtain

Transform device's attitude so that Z- axis is aligned with north and Y- is pointing gravity in CoreMotion?

戏子无情 提交于 2019-12-07 22:55:13
问题 I use CMAttitudeReferenceFrameXTrueNorthZVertical and this way rotation values roll, pitch and yaw are (0,0,0) when device is flat on table and X+ axis is pointing north. What I would like to do is to have (0,0,0) values when Z- axis is pointing north and Y is now pointing at gravity? Is this possible? 来源: https://stackoverflow.com/questions/9626749/transform-devices-attitude-so-that-z-axis-is-aligned-with-north-and-y-is-poin

CMDeviceMotion userAcceleration drift

家住魔仙堡 提交于 2019-12-07 13:20:12
问题 I'm getting the acceleration data using the -[CMDeviceMotion userAcceleration] I've noticed one interesting thing: I always get a small bias on the Z axis. It is about 0.0155 (with variance of 0.002). While on other axes the average values are near 0. I'm testing this with iPod Touch 4G (and it is just laying on the table during testing). The question is: where this bias is from and is it device specific? 回答1: I noticed similar values although CoreMotion tries to eliminate bias. If you rotate

Augmented Reality App in Landscape Mode

风流意气都作罢 提交于 2019-12-07 01:00:34
I am trying to build an augmented reality app using the CoreMotion framework. I have tried to go off of Apple's pARk sample code project, but it only works in portrait mode. I need it to work in landscape. When switched to landscape mode the subviews in the overlay view move in the opposite directions and at the wrong rate (they either move too fast or too slow across screen) I have read other postings that provide two solutions: Create a reference attitude and apply the inverse of that attitude to the current attitude, as suggested in the CoreMotion Tea Pot Example. Rotate the quaternion