accelerometer

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

Rotate marker as per user direction on Google Maps V2 Android

淺唱寂寞╮ 提交于 2019-11-27 00:38:45
问题 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 required. mCurrentLocationMarker.position(new LatLng( LocationUtils.sLatitude, LocationUtils.sLongitude)); mCurrentLocationMarker.icon(icon); mCurrentLocationMarker.flat(true); mCurrentLocationMarker.rotation(LocationUtils.sBearing); if (currentMarker != null) { currentMarker.setPosition(new LatLng

Which Android phones out there do have a gyroscope? [closed]

醉酒当歌 提交于 2019-11-27 00:27:58
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I find it very hard to get any consolidating information about which Android phones do have a gyroscope, or if there are Android phones with this sensor at all. I read about some (especially Samsung) phone models that have at least a 6-axis accelerometer, but I also read that this is different to a real

Filtering accelerometer data noise

谁都会走 提交于 2019-11-27 00:06:43
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 frequency components. I have read that Kalman filter might be the best candidate for this, but how do I integrate or use this method in my application which will mostly written in Android Java? or can it be done in the first place? or through Android NDK? Is there by any chance that this can be done in real-time? Any idea will be much appreciated. Thank you! Till The samples from Apple's SDK actually

how to calculate exact foot step count using accelerometer in android?

蓝咒 提交于 2019-11-26 23:54:37
问题 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 event) { Sensor sensor = event.sensor; synchronized (this) { if (sensor.getType() == Sensor.TYPE_ORIENTATION) {} else { int j = (sensor.getType() == Sensor.TYPE_ACCELEROMETER) ? 1 : 0; if (j == 1) { float vSum = 0; for (int i=0 ; i<3 ; i++) { final float v = mYOffset + event.values[i] * mScale[j];

iphone accelerometer speed and distance

久未见 提交于 2019-11-26 22:46:46
问题 I want to find distance traveled and velocity from accelerometer events. Like iphone's gMeter application is doing. Any suggestion, by which value or formula I should use for that? Thanks in advance. 回答1: You can use the acceleration values from the accelerometer to measure the velocity and distance. There is really good paper (Implementing Positioning Algorithms Using Accelerometers) which explains the errors you get from the accelerometer and the techniques to get the velocity and position

Android Low pass filter and High pass filter

旧时模样 提交于 2019-11-26 22:36:01
问题 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, (Case : I kept my cell phone idle on table) I get z Axis +ve value. Now If I think using basic physics, it gives me exact value(9.8approx) for small g i.e Acceleration due to gravity. To get the linear acceleration, If I add any force to phone it will change the Accelerometer value, but it will be g +

How to determine the direction of a iPhone shake

杀马特。学长 韩版系。学妹 提交于 2019-11-26 22:23:47
问题 I am using the accelerometer to scroll multiple subViews in a UIScrollVIew. I want the view (portrait orientation) to scroll to the right when the user flicks the iPhone to the right, and scroll to the left when the device is flicked to the left. I thought I could do that just by noting positive or negative x acceleration values, but I see that the values are usually a mixture of positive and negative values. I have set the floor at 1.5g to eliminate non-shake movement, and am looking at the

Accelerometer Low Pass Filtering

泪湿孤枕 提交于 2019-11-26 22:22:36
问题 Still on the BigNerdRanch iOS Development book. In the Accelerometer chapter, they first implement accelerometer tracking but it's fairly jumpy. They then suggest to apply a low pass filter to it by changing the original code: - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { HypnosisView *hv = (HypnosisView *)[self view]; [hv setXShift:10.0 * [acceleration x]]; [hv setYShift:10.0 * [acceleration y]]; [hv setNeedsDisplay]; } to this: - (void

How can i simulate accelerometer in android emulator? [closed]

强颜欢笑 提交于 2019-11-26 22:02:14
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? Owen Fraser-Green The Android emulator doesn't support it itself but OpenIntents' SensorSimulator fills the void. Download and unpack the zip file, then start the standalone jar file: $ java -jar bin/sensorsimulator.jar Next, install SensorSimulatorSettings on the emulator using the adb tool which comes with the SDK: $ adb -s <emulator device> install bin/SensorSimulatorSettings.apk (run adb devices to find the emulator device name). Finally, run