accelerometer

unity3d - Accelerometer sensitivity

耗尽温柔 提交于 2020-01-01 16:32:33
问题 I am testing the accelerometer code in Unity3D 4.3. What I want to do is simple change the object angle while tilting the ipad, to fake view angle like real live. Everything works fine except for the fact that the accelerometer is a bit too sensitive and I can see the GameObject is like of flickering even I put it on table. How can I make it less sensitive so that even when you hold with your hand the angle will change according to the tilt and the object remain steady? Here are my code: void

using Android Accelerometer to calculate distance , eleveation?

 ̄綄美尐妖づ 提交于 2020-01-01 06:37:28
问题 can it be determined that where a person is i.e is he walking ? is he in elevator ? or is he climbing up the stairs ? using android's accelerometer or is there any other way to calculate such in android ? 回答1: You can use a combination of the accelerometer and the digital compass, in phones that have them, to determine a speed and direction as mentioned in this post. If all you need to do is determine if the person is walking, all you need is the accelerometer. Just process its output for

Android: Algorithms for SensorManager.getRotationMatrix and SensorManager.getOrientation()

独自空忆成欢 提交于 2020-01-01 03:42:05
问题 To get orientation as a from of euler angles (e.g., pitch, roll, azimuth) in Android, it is required to execute followings: SensorManager.getRotationMatrix(float[] R, float[] I, float[] gravity, float[] geomagnetic); SensorManager.getOrientation(float[] R, float[] orientation); In the first one, I realize that it uses a kind of TRIAD algorithms; Rotation matrix (R[]) is composed of gravity, geomagnetic X gravity, gravity X (geomagnetic X gravity) --- X is cross product. See codes below: float

explanation of iOS rotation matrix

三世轮回 提交于 2020-01-01 03:14:14
问题 I am trying to work with 3D rotations but I don't seem to get the idea how the framework does the calculations. For example I get this data: yaw -1.010544 pitch 0.508249 roll 1.128918 Then I print the corresponding rotation matrix 0.599901 -0.128495 -0.789689 0.740043 0.464230 0.486649 0.304065 -0.876344 0.373584 After reading the API and the wiki, I am pretty sure there must be a general way to create a rotationmatrix out of euler angles. I tried all of these here, no results. Do I miss

How to Calibrate Android Accelerometer & Reduce Noise, Eliminate Gravity

心已入冬 提交于 2019-12-31 09:45:50
问题 So, I've been struggling with this problem for some time, and haven't had any luck tapping the wisdom of the internets and related SO posts on the subject. I am writing an Android app that uses the ubiquitous Accelerometer, but I seem to be getting an incredible amount of "noise" even while at rest, and can't seem to figure out how to deal with it as my readings need to be relatively accurate. I thought that maybe my phone (HTC Incredible) was dysfunctional, but the sensor seems to work well

Android Fall detection

蹲街弑〆低调 提交于 2019-12-31 02:09:12
问题 I am implementing the fall detection using accelerometer sensor, and create below code. public void onSensorChanged(SensorEvent foEvent) { if (foEvent.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { double loX = foEvent.values[0]; double loY = foEvent.values[1]; double loZ = foEvent.values[2]; double loAccelerationReader = Math.sqrt(Math.pow(loX, 2) + Math.pow(loY, 2) + Math.pow(loZ, 2)); mlPreviousTime = System.currentTimeMillis(); Log.i(TAG, "loX : " + loX + " loY : " + loY + " loZ : " +

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

折月煮酒 提交于 2019-12-30 05:09:25
问题 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

How to detect walking with Android accelerometer

跟風遠走 提交于 2019-12-29 03:05:51
问题 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]

How to detect walking with Android accelerometer

烂漫一生 提交于 2019-12-29 03:05:33
问题 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]

How to use Shake API in iPhone SDK 3.0?

只愿长相守 提交于 2019-12-28 01:55:36
问题 Apple annonced Shake API in iPhone SDK 3.0. I can not find any information regarding this new feature. Who knows about how to use it? Any example, link will be good. 回答1: The APIs you are looking for are in UIResponder: - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event; - (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event; - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event; Generally you just implement this: - (void)motionEnded: