accelerometer

Impossibility to change the rate of the accelerometer

霸气de小男生 提交于 2019-11-30 18:56:57
问题 I have to collect accelerometer data from my Android phone, so I have made a little program to do that. After some tests, I have found that my Nexus S accelerometer's rate is always 50 values per second when the phone is active, and 6 values per second when it is asleep (with a PARTIAL_WAKE_LOCK ), whatever the rate I ask for ( NORMAL , UI , GAME or FASTEST ). So I decided to install an application found on the Internet which tests the rate of the accelerometer : http://samoht.fr/tuto

Is there any way to remove the small bias along the gravity axis in the accelerometer data

不问归期 提交于 2019-11-30 18:20:28
问题 Similar to this question: CMDeviceMotion userAcceleration drift I'm using CMDeviceMotion.userAcceleration in iOS5 SDK to plot its x, y, z components over time. Like the above post, I see z acceleration component shows always small positive values (0.005 - 0.015) while x and y components are centering along zero (-0.005 - 0.005) when my iPhone 4s is sitting on a flat surface. This small bias keeps adding up to the estimated velocity (which I compute by integrating the acceleration data) even

Obtain absolute rotation using CMDeviceMotion?

十年热恋 提交于 2019-11-30 17:51:28
问题 I'm building a simple game with Sprite Kit, the screen doesn't rotate but I want to know the angle the user is holding the phone for a game mechanic. The values I want to get can be easily retrieved with the accelerometer (x, y) but I have found this to be unreliable so I'm trying to archive better results with CMDeviceMotion . I could obtain the equivalent to data.acceleration.y but I can't figure out how to get the equivalent of data.acceleration.x . if let data = motionManager

How to program smooth movement with the accelerometer like a labyrinth game on iPhone OS?

孤街醉人 提交于 2019-11-30 17:25:35
问题 I want to be able to make image move realistically with the accelerometer controlling it, like any labyrinth game. Below shows what I have so far but it seems very jittery and isnt realistic at all. The ball images seems to never be able to stop and does lots of jittery movements around everywhere. - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { deviceTilt.x = 0.01 * deviceTilt.x + (1.0 - 0.01) * acceleration.x; deviceTilt.y = 0.01 *

Does the accelerometer drain battery on Android Wear? (Android watch)

五迷三道 提交于 2019-11-30 15:34:08
I'm creating an Android Wear app that tries to detect some of the hand movements, to do it, I need to continuously monitor the accelerometer output . I'm wondering how it will affect the battery life. For phones, I know that there are methods like "disable accelerometer while screen is turned off" to save battery, but what's the battery cost in case of watches? Since Android watch can count your steps and it turns on the screen when you face it towards your face, I believe the accelerometer is turned-on all the time anyway. in this case, will my app drain the battery? (Calculations after

Android - How to approach fall detection algorithm

风格不统一 提交于 2019-11-30 10:49:31
问题 I want to be able to feature a fairly simple fall detection algorithm in my application. At the moment in onSensorChanged(), I am getting the absolute value of the current x,x,z values and subtracting SensorManager.GRAVITY_EARTH (9.8 m/s) from this. The resulting value has to be bigger than a threshold value 10 times in a row to set a flag saying a fall has been detected by the accelerometer, the threshold value is about 8m/s. Also I'm comparing the orientation of the phone as soon as the

How to obtain only linear acceleration from accelerometer using gyroscope?

↘锁芯ラ 提交于 2019-11-30 10:23:24
I have a small remote controlled car going on the room floor. For simplicity let us assume it is moving along say x-axis. Now, the floor seems flat but there are very minute uneven bumps in every surface. So whenever the car is not exactly flat (as it was at starting position) or in other words whenever the car has even slightest of tilt then, Total Acceleration obtained from accelerometer = Linear Acceleration + Acceleration due to tilt My question is how to remove the acceleration due to tilt so that I get only linear acceleration? Can I somehow use gyroscope to do that? Ali I have

Tap pressure strength detection using CPBPressureTouchGestureRecognizer

▼魔方 西西 提交于 2019-11-30 10:22:12
it's working great with one UIButton: – (void) viewDidLoad { [super viewDidLoad]; CPBPressureTouchGestureRecognizer* recognizer = [[CPBPressureTouchGestureRecognizer alloc] initWithTarget:self action:@selector(A_button:)]; [A_button addGestureRecognizer: recognizer]; [recognizer release]; } - (void) A_button: (CPBPressureTouchGestureRecognizer*) recognizer { [pan_A setGain:recognizer.pressure]; [pan_A] play; } i tried to use more but only the second one is working: - (void) viewDidLoad { [super viewDidLoad]; CPBPressureTouchGestureRecognizer* recognizer1 = [[CPBPressureTouchGestureRecognizer

Android Accelerometer Profiling

感情迁移 提交于 2019-11-30 10:19:44
问题 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 file. Added to this X,Y,Z is a label, the label is specific to the activity i am performing. so its X,Y,Z,label Like this i obtain my activity profile. Would like to have suggestions on what operations to perform after data collection so as to remove noise and get the best data for an activity.

Android bouncing ball

老子叫甜甜 提交于 2019-11-30 10:19:06
So i'm just trying to make a ball bounce around the screen which should slow down due to gravity and reflect (bounce) from the wall like a normal ball would. Can someone give some basics and VERY simple implementation of this? Other examples seem a bit "overdone" and seem to go beyond what I want to do. I've tried this: public void updateLogic() { if (x < -1) { xPos += (-x * gravity); } else if (x > 1) { xPos -= (x * gravity); } if (y > 1) { yPos += (y * gravity); } else if (y < -1) { yPos -= (-y * gravity); } } This is the closest I got by myself. By the way the x and y values are from the