gyroscope

Detecting iOS orientation change instantly

最后都变了- 提交于 2019-11-27 10:23:39
I have a game in which the orientation of the device affects the state of the game. The user must quickly switch between Landscape, Portrait, and Reverse Landscape orientations. So far I've been registering the game for orientation notifications via: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; But it is far too slow - there seems to be about a second delay between rotating the phone and the notification actually being fired. I need a way to INSTANTLY detect changes in the device's orientation. I have tried experimenting with the gyroscope, but am not yet familiar

Finding normal vector to iOS device

纵饮孤独 提交于 2019-11-27 10:01:24
问题 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

Android Gyroscope examples?

China☆狼群 提交于 2019-11-27 08:59:22
I'm sure this has been asked here many times but, are there any examples on the Internet about gyroscope Android development. Because the Gyroscope intrigues me and I think it could make for a pretty good thing to work with. I am just guessing the Samsung Galaxy S has a gyroscope, right? I hope so. Again though, my main need is for a tutorial, maybe even a good android programming tutorial/book (not just gyroscope related). I learned Java just for the purpose of Android development. I already knew C and a little OBJ-C so learning Java took a few weeks. So, one more time does anyone know any

Get rotation and display in degrees

北慕城南 提交于 2019-11-27 05:52:50
问题 I need something very simple, but I could not find a suitable example to learn from. My sole purpose is the following: As the device is placed flat (on its back) on the desk, it should show 0 (or close to 0) for X and Y axis. When I lift it from the top part (where the speaker is) and the bottom part (where the microphone is) stays put down - it should show me how many degrees is the phone tilted. Mathematically described - show in degrees the angle between the back of the phone and the table

Compensating compass lag with the gyroscope on iPhone 4

 ̄綄美尐妖づ 提交于 2019-11-27 04:11:02
问题 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

Are there any well known algorithms to count steps based on the accelerometer?

旧时模样 提交于 2019-11-27 01:29:48
问题 I'm implementing an accelerometer-based pedometer, and I was wondering if there was any known algorithms to handle that. 回答1: You have probably found this: Enhancing the Performance of Pedometers Using a Single Accelerometer Anyhow, I am also interested in finding a good algorithm, I am curios what other answers you will get. :) 回答2: There is an app called Sensor data that you can uses to gather experimental data so you can then analyze it and try to find an algorithm. Its going to be quite

Detect when an iphone has been bumped

余生长醉 提交于 2019-11-27 00:49:02
问题 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

track small movements of iphone with no GPS

☆樱花仙子☆ 提交于 2019-11-26 18:26:47
问题 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

How to access accelerometer/gyroscope data from Javascript?

寵の児 提交于 2019-11-26 18:03:32
I have recently come across a few websites that seems to access the accelerometer or gyroscope on my laptop, detecting changes in orientation or movement. How is this done? Must I subscribe to some kind of event on the window object? On which devices (laptops, mobile phones, tablets) is this known to work? NB : I actually already know (part of) the answer to this question, and I am going to post it right away. The reason that I am posting the question here, is to let everyone else know that accelerometer data is available in Javascript (on certain devices) and to challenge the community to

Android Gyroscope examples?

眉间皱痕 提交于 2019-11-26 17:47:41
问题 I'm sure this has been asked here many times but, are there any examples on the Internet about gyroscope Android development. Because the Gyroscope intrigues me and I think it could make for a pretty good thing to work with. I am just guessing the Samsung Galaxy S has a gyroscope, right? I hope so. Again though, my main need is for a tutorial, maybe even a good android programming tutorial/book (not just gyroscope related). I learned Java just for the purpose of Android development. I already