accelerometer

How to detect walking with Android accelerometer

喜夏-厌秋 提交于 2019-11-28 17:18:27
I'm writing an application and my aim is to detect when a user is walking. I'm using a Kalman filter like this: float kFilteringFactor=0.6f; gravity[0] = (accelerometer_values[0] * kFilteringFactor) + (gravity[0] * (1.0f - kFilteringFactor)); gravity[1] = (accelerometer_values[1] * kFilteringFactor) + (gravity[1] * (1.0f - kFilteringFactor)); gravity[2] = (accelerometer_values[2] * kFilteringFactor) + (gravity[2] * (1.0f - kFilteringFactor)); linear_acceleration[0] = (accelerometer_values[0] - gravity[0]); linear_acceleration[1] = (accelerometer_values[1] - gravity[1]); linear_acceleration[2]

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

Measuring velocity via iPhone SDK

天涯浪子 提交于 2019-11-28 16:35:29
I need to implement a native iPhone app to measure the velocity of the phone (basically a speedometer). I know that you can do so via the CoreLocation API fairly easily, but I am concerned about battery consumption since this is to be a real-time measurement that could be used for up to a couple of hours at a time. My understanding is that while you are actively monitoring for events from the LocationManager (even though I don't actually care about GPS location) it is battery-intensive. The other obvious option to explore would be using the accelerometers to try and calculate speed, but there

How to do Gesture Recognition using Accelerometers

微笑、不失礼 提交于 2019-11-28 16:15:16
My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate. Does anyone have recommendations for how to do this? Any available libraries in Java? Sample projects you recommend I check out? Papers you recommend? The sun spot is a Java platform to help you make quick prototypes of systems. It is programmed using Java and can relay commands back

Understanding FFT output

喜你入骨 提交于 2019-11-28 14:59:46
I need some help understanding the output of the DFT/FFT computation. I'm an experienced software engineer and need to interpret some smartphone accelerometer readings, such as finding the principal frequencies. Unfortunately, I slept through most of my college EE classes fifteen years ago, but I've been reading up on DFT and FFT for the last several days (to little avail, apparently). Please, no responses of "go take an EE class". I'm actually planning to do that if my employer will pay me. :) So here is my problem: I've captured a signal at 32 Hz. Here is a 1 second sample of 32 points,

Orientation from Android Accelerometer

时光毁灭记忆、已成空白 提交于 2019-11-28 12:00:55
I testing the accelerometer output on 2 different devices(Elocity A7 and Archos 7 Home tablet) but the sensor seems to be giving different results. I have it programmed to set to landscape mode but the x and y axis seem to be the oppisite between the 2 devices. The x axis returns 10 when held perpendicular to the ground and the Archos X axis returns 0. The Elocity tablet is android 2.2 and the Archos is 2.1. Can someone point me in the right direction as how to get orientation from the accelerometer in sync between these 2 devices? In fact, the accelerometer axises are relative to the default

Enable iPhone accelerometer while screen is locked

巧了我就是萌 提交于 2019-11-28 11:11:21
So apparently it is possible to keep the processor going processing stuff while the screen is locked, as indicated here: Running IPhone apps while in sleep mode However, after testing with the example code, UIAccelerometer will just stop giving value as soon as the device is locked pronto. Is there a way to force otherwise? There was a bug in iPhone OS prior to 3.1.2 that caused the accelerometer to stop returning values as soon as the screen was blanked. You may be running into this same issue. I filed a bug with Apple about it and they fixed it in 3.1.2. One trick I use in an app is to

calculate acceleration in reference to true north

牧云@^-^@ 提交于 2019-11-28 08:49:36
For my App I need to calculate the acceleration of my device in reference to true north. My idea was to calculate the device orientation to magnetic north and apply the declination to it to get the orientation to true north. Then I want to calculate the acceleration of the device and reference it to the orientation, but I do not know how I should do this. I would try to get the device orientation using SensorManager.getRotationMatrix() and SensorManager.getOrientation() . Then I get the declination by GeomagneticField.getDeclination() and apply it on the azimuth of the orientation values from

Detect iPhone screen orientation

你。 提交于 2019-11-28 07:51:25
I'm wanting to detect the orientation of the iPhone at 45 degree increments. Ideally I'd like to be able to get the angle of orientation along any axis. The detection I need to do is similar to how Trism for the iPhone flashes an arrow towards the current bottom position of the screen when orientation changes. I have something coded up but really don't understand how the accelerometer readings work and could use a nudge in the right direction. My current code logs the current angle but even when the phone is flat I get readings varying wildly a few times a second. - (void) checkOrientation:

How can I find the velocity using accelerometers only?

你说的曾经没有我的故事 提交于 2019-11-28 06:35:00
Using only the phone's (Android) built in accelerometer, how would I go about finding its velocity? I have been tinkering with the maths of this but whatever function I come up with tends to lead to exponential growth of the velocity. I am working from the assumption that on startup of the App, the phone is at a standstill. This should definitely make finding the velocity (at least roughly) possible. I have a decent background in physics and math too, so I shouldn't have any difficulty with any concepts here. How should I do it? First, you have to remove the acceleration due to gravity from