Questions tagged [accelerometer]
An accelerometer is a device that measures the proper acceleration of the device.
accelerometer
2,582
questions
346
votes
17
answers
127k
views
How do I detect when someone shakes an iPhone?
I want to react when somebody shakes the iPhone. I don't particularly care how they shake it, just that it was waved vigorously about for a split second. Does anyone know how to detect this?
258
votes
17
answers
126k
views
How to refresh app upon shaking the device?
I need to add a shake feature that will refresh my Android application.
All I find of documentation involves implementing the SensorListener, but Eclipse tells me it's deprecated and suggest ...
152
votes
4
answers
128k
views
How to access accelerometer/gyroscope data from Javascript?
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 ...
118
votes
6
answers
106k
views
Android accelerometer accuracy (Inertial navigation)
I was looking into implementing an Inertial Navigation System for an Android phone, which I realise is hard given the accelerometer accuracy, and constant fluctuation of readings.
To start with, I ...
99
votes
4
answers
54k
views
Understanding FFT output
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 ...
76
votes
5
answers
78k
views
Indoor Positioning System based on Gyroscope and Accelerometer
I am developing an Android App to track indoor position. My phone is an Google Nexus S using two sensors, the first being an Accelerometer and the second being a Gyroscope.
My idea is that from a ...
75
votes
6
answers
28k
views
Android accelerometer not working when screen is turned off
I'm developing an application for my final thesis on computer science, and I need to collect and log accelerometer data. I need to acquire it for a whole day long, so there are serious battery ...
73
votes
2
answers
107k
views
Combine Gyroscope and Accelerometer Data
I am building a balancing robot using the Lego Mindstorm's NXT system. I am using two sensors from HiTechnic, the first being an Accelerometer and the second being a Gyroscope. I've successfully ...
52
votes
7
answers
70k
views
How can I find distance traveled with a gyroscope and accelerometer?
I want to build an app that calculates accurate Distance travelled by iPhone (not long distance) using Gyro+Accelerometer. No need for GPS here.
How should I approach this problem?
52
votes
7
answers
92k
views
How is it possible that Google Fit app measures number of steps all the time without draining battery?
The Google Fit app, when installed, measures the duration you are walking or running, and also the number of steps all the time. However, strangely, using it does not seem to drain the battery. Other ...
51
votes
2
answers
46k
views
Gyroscope vs Accelerometer?
Now that iOS 4 is no longer NDA, I would like to know what Gyroscope has to offer over the Accelerometer for developers. Is there a difference in APIs? Other things?
50
votes
11
answers
80k
views
Detect change in orientation using javascript
Is it possible to detect change in orientation of the browser on the iPad or Galaxy Tab using javascript? I think it's possible using css media queries.
45
votes
5
answers
56k
views
How can i simulate accelerometer in android emulator? [closed]
I don't have an Android phone right now. But in my application I need to use the accelerometer values. How can I do this in a simulated environment?
44
votes
5
answers
50k
views
How to get iPhones current orientation?
Is there a special method to get iPhones orientation? I don't need it in degrees or radians, I want it to return an UIInterfaceOrientation object. I just need it for an if-else construction like
if(...
44
votes
5
answers
94k
views
how to calculate exact foot step count using accelerometer in android?
I am developing some application like Runtastic Pedometer using the algorithm but I am not getting any similarity between the results.
my code is as follows:
public void onSensorChanged(SensorEvent ...
42
votes
6
answers
56k
views
Android TYPE_LINEAR_ACCELERATION sensor - what does it show?
I am developing application for car acceleration tracking. I used standard accelerometer, calibrating it in specific position beforehand.
Then, assuming phone's orientation is not changing, I logged ...
41
votes
3
answers
96k
views
How do I use the Android Accelerometer?
I'm trying to build an app for reading the values from the accelerometer on my phone, which supports Android 2.1 only.
How do I read from the accelerometer using 2.1-compatible code?
38
votes
3
answers
35k
views
How to measure the tilt of the phone in XY plane using accelerometer in Android
I tried to use the Z axis data from SensorEvent.values, but it doesn't detect rotation of my phone in the XY plane, ie. around the Z-axis.
I am using this as a reference for the co-ordinate axes. Is ...
38
votes
7
answers
69k
views
FFT library in android Sdk [closed]
I am working with android project.I need FFT algorithm to process the android accelerometer data.Is there FFT library available in android sdk?
35
votes
5
answers
35k
views
When to use accelerometer or gyroscope on Android
Is it ok to assume most of the user devices will have a gyroscope? In other words will I be excluding a significant number of people by using a gyroscope in my app?
I'm making a children's storybook ...
35
votes
1
answer
11k
views
Gyroscope on iPhone
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:(...
33
votes
2
answers
14k
views
How Nike+ GPS on iPhone receives accelerometer updates in the background?
The new Nike+ GPS application for iOS 5 is able to process accelerometer events in the background (thus allowing for indoor treadmill tracking). How is this possible? When I put my application in ...
30
votes
4
answers
24k
views
Acceleration from device's coordinate system into absolute coordinate system
From my Android device I can read an array of linear acceleration values (in the device's coordinate system) and an array of absolute orientation values (in Earth's coordinate system). What I need is ...
28
votes
2
answers
2k
views
Set iPhone accelerometer to ±8g mode
Is it possible to set iPhone accelerometer to receive data in the ±8g range?
(as far as I know ST LIS331DLH accelerometer installed on iPhone supports this mode)
We are looking not only into standard ...
27
votes
4
answers
59k
views
calculating distances using accelerometer
After reading many researches and papers beside to many forums about how to measure the distance based on the acceleration data
I found the double integration method, but the error related to this ...
26
votes
2
answers
25k
views
Using Android gyroscope instead of accelerometer. I find lots of bits and pieces, but no complete code
The Sensor Fusion video looks great, but there's no code:
http://www.youtube.com/watch?v=C7JQ7Rpwn2k&feature=player_detailpage#t=1315s
Here is my code which just uses accelerometer and compass. I ...
26
votes
5
answers
38k
views
Filtering accelerometer data noise
How do I filter noise of the accelerometer data in Android? I would like to create a high-pass filter for my sample data so that I could eliminate low frequency components and focus on the high ...
26
votes
5
answers
5k
views
How does knocktounlock work?
I am trying to figure out how knocktounlock.com is able to detect "knocks" on the iPhone. I am sure they use the accelerometer to achieve this, however all my tries come up with false flags (if user ...
25
votes
5
answers
20k
views
Accelerometer stops delivering samples when the screen is off on Droid/Nexus One even with a WakeLock
I have some code that extends a service and records onSensorChanged(SensorEvent event) accelerometer sensor readings on Android. I would like to be able to record these sensor readings even when the ...
24
votes
4
answers
30k
views
Android Low pass filter and High pass filter
I have a very basic question.
What is Low Pass filter and High Pass filter in case of Android Accelerometer?
When I see the output from the Accelerometer Sensor, I see If I don't use any filter, (...
23
votes
3
answers
31k
views
Rotate marker as per user direction on Google Maps V2 Android
I want to rotate marker as per bearing or sensor value received from Accelerometer to show the user where actually he is moving. I have set marker icon and flat value to true but its not working as ...
23
votes
1
answer
19k
views
Why is accelerometer:didAccelerate: deprecated in IOS5?
The release of IOS5 has this core function listed as deprecated. Does anyone know what will replace it? I'm assuming that apple is not going to remove the accelerometer from iPhone 5.
22
votes
2
answers
47k
views
What is the difference between "gravity" and "acceleration" sensors in Android?
What is the difference between gravity and acceleration sensors in Android? From my point of view the physical value is the same in both cases.
Which one measures the force acting on unit mass inside ...
22
votes
1
answer
1k
views
Can we Draw line in android canvas between two points given by gyroscope?
Is it possible to draw a line from Point A(where user touched first) and Point B(where user touched second) in android over a camera.
The user can touch first point and rotate his camera in other ...
21
votes
4
answers
27k
views
android remove gravity from accelerometer readings
I am developing an application for Android where I need to remove gravity from accelerometer readings. I have read multiple discussions on this problem, I have also found an algorithm here, but I didn'...
21
votes
4
answers
20k
views
Getting displacement from accelerometer data with Core Motion
I am developing an augmented reality application that (at the moment) wants to display a simple cube on top of a surface, and be able to move in space (both rotating and displacing) to look at the ...
20
votes
4
answers
20k
views
How to do Gesture Recognition using Accelerometers
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 ...
20
votes
5
answers
29k
views
How to detect walking with Android accelerometer
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] * ...
20
votes
2
answers
33k
views
How can I get the direction of movement using an accelerometer?
I'm developing a Android application and I would like to know if is possible detect the direction of movement with one axis fixed. For example, I want put my phone on the table and detect the ...
19
votes
4
answers
11k
views
Is there any way to access the accelerometer from the Apple Watch?
It doesn't look like WatchKit released today has such API included.
19
votes
2
answers
36k
views
Using accelerometer, gyroscope and compass to calculate device's movement in 3D world
I'm working on an android application which can calculate device's movement in 6 direction. I think I can use acceleration as;
"x=a.t^2" but a is not a constant. And this is the problem. How can I ...
19
votes
5
answers
24k
views
How to determine absolute orientation
I have a xyz accelerometer and magnetometer. Now I want to determine the orientation of the device using both. The problem I see is that depending on the device orientation, I'd need to use the ...
18
votes
7
answers
56k
views
How to remove Gravity factor from Accelerometer readings in Android 3-axis accelerometer
Can anyone help on removing the g factor from accelerometer readings?
I am using SensorEventListener with onSensorChanged() method for getting Sensor.TYPE_ACCELEROMETER data. I need only pure ...
18
votes
6
answers
38k
views
Access accelerometer via Javascript in Android?
Is there any way to access accelerometer data using Javascript on Android's browser? I know it supports "onorientationchange", but I'd like to get everything.
Clarification: I'm asking how to do ...
18
votes
1
answer
7k
views
Continuous accelerometer updates while in the background on iOS
I have researched this topic thoroughly before asking the question but need to ensure that I have come to the right conclusions and, if so, I would like help on implementing this as efficiently as ...
17
votes
3
answers
14k
views
Android Accelerometer Profiling
I have written a simple Activity which is a SensorEventListener for Sensor.TYPE_ACCELEROMETER.
In my onSensorChanged(SensorEvent event) i just pick the values in X,Y,Z format and write them on to a ...
17
votes
4
answers
26k
views
Detect user activity (running, cycling, driving) using Android
Using my Android device how can I detect if the user is walking, cycling or driving?
I have checked the Google Fit app. It differentiates between running, cycling and driving. I am puzzled about what ...
17
votes
2
answers
36k
views
Read x y z coordinates of android phone using accelerometer
I am going to develop Android application which needs to read x,y,z coordinates of phone on 3D space.
I would like to write a simple code and test on the device..
I am using ginger bread on both the ...
17
votes
2
answers
12k
views
How do I detect if a device has a gyroscope in a web browser?
I am using THREE.js and creating a web-app where the user can rotate the device and the scene will move accordingly. Something similar to this.
I am having a problem differentiating between devices ...
16
votes
4
answers
164k
views
Rotate object in Unity 3D
I can use the following code to rotate object using accelerometer.
transform.rotation = Quaternion.LookRotation(Input.acceleration.normalized, Vector3.up);
But i would like to rotate object like for ...