accelerometer

GPS V.S. accelerometer to calculate distance

冷暖自知 提交于 2019-12-05 16:59:00
问题 I am trying to implement a fitness app that can keep track of the running speed and running distance in Android. It looks like I can either use GPS or Accelerometer to calculate these information. Since a runner may put his phone in hand, on the shoulder or in his pocket, my first intuition is to use GPS to get locations and calculate running speed and running distance. But recently someone telled me that I can also use Accelerometer also does that. My question is: In Android, which approach

Calculate Jerk and Jounce from iPhone accelerometer data

孤者浪人 提交于 2019-12-05 09:25:03
问题 I am trying to calculate Jerk (http://en.wikipedia.org/wiki/Jerk_(physics)) and jounce (http://en.wikipedia.org/wiki/Jounce) with the acceleration data from the accelerometer. I think I have Jerk figured out, but I am not sure what I am doing for jounce is correct. Can anyone confirm or deny what I am doing is giving me correct values (Do I need to take into consideration time?) #define kFilteringFactor 0.4 float prevAccelerationX; float prevAccelerationY; float prevAccelerationZ; float

class or interface expected

北城余情 提交于 2019-12-05 08:47:18
I used to use eclipse with android sdk but I just downloaded android studio. I wanted to use the accelerometer but for some reason I keep getting the same issue."Class or Interface expected" I am attaching the code below,if anyone can give me a solution to the problem, I will be obliged. package com.example.symbox.myapplication; import android.app.Activity; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.support.v7.app.ActionBarActivity; import

Kalman filter and quality of internal state variables

早过忘川 提交于 2019-12-05 07:59:54
I am trying to develop motion detection application for Android. App should be able to track motion of phone in space and map it to motion on computer screen. I am using 3-axis accelerometer and since data is very noisy I am using Kalman filter. Internal state is 6 component vector [speed-x, speed-y, speed-z, accel-x, accel-y, accel-z] and measured state is 3 component vector [accel-x, accel-y, accel-z]. Filter works very well on measured values, but speed is still very noisy. Now I am wondering if this is normal behavior or am I doing something wrong, since my understanding of Kalman filter

IPhone Accelerometer Determine Motion

无人久伴 提交于 2019-12-05 05:49:49
问题 Using the accelerometer output, how do I determine if the user (iphone mounted on waist) is walking? Looking for a good algorithm to determine if the user is walking to determine activity transitions- standing-to-walking or walking-to-standing. please help. Thank you for your time. 回答1: For a previous project, I tried calculating the magnitude of the acceleration vector, and just setting a threshold of about 2g, and that worked pretty well in testing. A typical (hardware) pedometer will

Accelerometer's Min and Max value range and sensor data conversion

拈花ヽ惹草 提交于 2019-12-05 04:45:56
问题 I have moto g 16 GB device from Motorola. It has LIS3DH 3 axis Accelerometer. For reading Max and Min value of Accelerometer i have used this APIs. getMaximumRange() Some says its shows zero to Pick or pick to pick But for my device i get value 39.24 so i though 39.24 / 9.8 = ~4.00 s my range is +/- 4g But when i simply read x,y,z data and store it in file and see the values when giving max acceleration to the my smart phone then its shows values up to 76 m/sec2 What the meaning of this? Is

Drawing in air with Android phone

爷,独闯天下 提交于 2019-12-05 03:21:43
I am working on an application to draw in the air with an android phone. As my phone is moving, thanks to the acceletometer, i retrieve the acceleration on each axis ax, ay, az. What I am interested in is: x,y,z. From what I read in forums and in some tutorials, integrating the accelaration twice gives huge errors. So what is the best solution for me to get information on the deplacement of the phone? Thanks for your help. Ali Not exactly what you are looking for: Store orientation to an array - and compare Tracking orientation works well. Perhaps you can do something similar with the

Objective C: Detecting a shake

若如初见. 提交于 2019-12-05 02:31:18
I'm using the shake api like this: - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { if (event.subtype == UIEventSubtypeMotionShake) { [img stopAnimating]; } } How do I detect that the shaking has stopped? You are on the right track, however, there are still more things you need to add to detect shaking: You can test this by adding an NSLog to the motionBegan or motionEnded methods, and in the Simulator, press CONTROL + COMMAND + Z #pragma mark - Shake Functions -(BOOL)canBecomeFirstResponder { return YES; } -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:NO];

how to detect this specific movement gesture via sensors?

泪湿孤枕 提交于 2019-12-05 02:28:11
问题 I'm working on an Android project. it's goal is to detect predefined movement gesture of the device. if the device rotates 45 degrees over an axis(X,Y or Z) and then rotates back to its first position( the first and second positions are not going to be accurate, I mean if it was rotated 50 degrees instead of 45, not important !!!)then the gesture has happened and the app should detect it. I tried to do that using Accelerometer and Magnetic sensors of device to continually monitor the

Sony Smartwatch SW2 - accelerometer output rate

佐手、 提交于 2019-12-04 21:42:47
From the sample code of the SDK, I can read the accelerometer at 4-5Hz by using: registerListener(listener, Sensor.SensorRates.SENSOR_DELAY_FASTEST, Sensor.SensorInterruptMode.SENSOR_INTERRUPT_ENABLED); but it does not work when using registerFixedRateListener(). How to read accelerometer data from SW2 with higher rate? for example 10Hz, 20Hz... Thanks. I'm able to read values on my SW 2 at 10Hz with disabled interrupts using sensor.registerFixedRateListener(mListener, Sensor.SensorRates.SENSOR_DELAY_FASTEST); However, 10 Hz seems to be the limit. 来源: https://stackoverflow.com/questions