gyroscope

Sensor Fusion on iOS Devices

北城以北 提交于 2019-11-28 19:19:10
问题 I'm trying to find out how could I start to implement sensor fusion on the iPhone. I've started from this talk from David Sachs: Sensor Fusion on Android Devices Although David's talk is very illustrative, it doesn't show any code (it makes sense). I've seen both the GLGravity (to extract the gravity vector) and the AccelerometerGraph examples, but I need some help or at least guidance on how to combine the accelerometer, gyroscope and compass inputs so that the result is similar to what

Gyroscope on iPhone

别来无恙 提交于 2019-11-28 17:06:54
问题 I need some help using gyroscope on iPhone. I can't understand readings from CMAttitude regarding pitch, roll and yaw in a particular situation. This is my code - (void)handleDeviceMotion:(CMDeviceMotion*)motion { NSLog(@"Yaw %f ",attitude.yaw * 180 / M_PI); NSLog(@"Pitch %f ",attitude.pitch * 180 / M_PI); NSLog(@"Roll %f ",attitude.roll * 180 / M_PI); } Let's suppose that iPhone is laying down on a plane as in the following figure: pitch, roll and yaw are (almost) 0 degrees and any turn

Finding normal vector to iOS device

拥有回忆 提交于 2019-11-28 16:52:38
I would like to use CMAttitude to know the vector normal to the glass of the iPad/iPhone's screen (relative to the ground). As such, I would get vectors like the following: Notice that this is different from orientation, in that I don't care how the device is rotated about the z axis. So if I was holding the iPad above my head facing down, it would read (0,-1,0), and even as I spun it around above my head (like a helicopter), it would continue to read (0,-1,0): I feel like this might be pretty easy, but as I am new to quaternions and don't fully understand the reference frame options for

Detect when an iphone has been bumped

荒凉一梦 提交于 2019-11-28 05:08:55
I want to be able to detect if an iphone has been bumped into something...would it be best to listen to the gyroscope / accelerometer and judge how fast its moved or if its moved and stopped suddenly. In fact how would I judge if the device has moved then stopped suddenly? This answer is great but in reverse iOS: Accurately determining energy of a bump from accelerometer output - it smooths out the movement, if anything I want to detect a sharp movement. Also are both the Gyroscope and Accelerometer available for 3GS ? UPDATED WITH CODE From the Apple doc http://developer.apple.com/library/iOS

Getting Direction Vector in Android

∥☆過路亽.° 提交于 2019-11-27 18:04:34
问题 How can I get a direction vector representing the direction the back of the device is pointing relative to earth coordinates? For example, if place down on a desk (screen facing up) it should read [0,0,-1] and if held vertically facing north it should read [1,0,0], etc. I know how to calculate it from heading, pitch, and roll, as long as those are relative to earth coordinates. To be clear here I am not looking for angular velocity, but the actual current angle relative to the plane tangent

Compensating compass lag with the gyroscope on iPhone 4

北慕城南 提交于 2019-11-27 17:05:20
I've been experimenting with the compass and gyroscope on iPhone 4 and would like some help with an issue I'm having. I want to compensate for the slowness of the compass by using data from the gyroscope. Using CMMotionManager and its CMDeviceMotion object ( motionManager.deviceMotion ), I get the CMAttitude object. Correct me if I'm wrong (please), but here is what I've deduced from the CMAttitude object's yaw property (I don't need pitch nor roll for my purposes): yaw ranges from 0 to PI when the phone is pointing downwards (as indicated by deviceMotion.gravity.z ) and swinging

Drifting yaw angle after moving fast

隐身守侯 提交于 2019-11-27 15:20:34
问题 In my current project I ran into trouble regarding the quaternion provided by Core Motion's CMAttitude. I put the iPhone 5 (iOS 6.0.1) at a well defined start position. Then I start to move the device quickly around like in a fast pacing game. When I return to the start position after 10-30 seconds the reported yaw angle differ from the start position for 10-20 degrees (most of the time ≈11°). I used the old (and sadly no longer available) Core Motion Teapot sample to validate the effect. The

track small movements of iphone with no GPS

一曲冷凌霜 提交于 2019-11-27 14:50:34
I have to write an application for iphone that tracks the movement of the iphone itself, given its initial position, without ever using GPS. That is, I can only use data provided by the gyroscope and the accelerometer. The distances I need to measure are rather small and the precision I'm looking for is 40-50cm (~2 feet) at the very most. Is this possible? If so, what's the best way to go about it? Also, do you know of any existing (and possibly open source) projects that have implemented this already? Thanks a lot! Ali If you integrate the acceleration twice you get position but the error is

Get quaternion from Android gyroscope?

做~自己de王妃 提交于 2019-11-27 14:13:15
问题 The official development documentation suggests the following way of obtaining the quaternion from the 3D rotation rate vector (wx, wy, wz) . // Create a constant to convert nanoseconds to seconds. private static final float NS2S = 1.0f / 1000000000.0f; private final float[] deltaRotationVector = new float[4](); private float timestamp; public void onSensorChanged(SensorEvent event) { // This timestep's delta rotation to be multiplied by the current rotation // after computing it from the

How to measure the speed of car by phone with accelerometer and gyroscope?

旧巷老猫 提交于 2019-11-27 13:29:34
问题 I want to know current speed of car and make a passed path. I have an Android phone with accelerometer and gyroscope which sent me data. This is the data in phone system of coordinate that probably wouldn't the same as coordiante system of car. How I can transform this accelerations and rotations to car system of coordinate? 回答1: The generic answer for your generic question is no . The acceleration measures the changes in the speed, so the best you could get from acceleration, is the speed