gyroscope

Gyroscope Issues with Device Orientation

浪尽此生 提交于 2019-12-20 09:44:44
问题 I'm getting pitch and roll data from my device's gyroscope using this tutorial: http://www.thousand-thoughts.com/2012/03/android-sensor-fusion-tutorial/ All the readings are extremely accurate (there's a filter applied to the code in the tutorial to eliminate gyro drift). Unfortunately, the code only works when my device is placed flat on a surface that is parallel to the ground. The most ideal position for my app to work would be with the top of the device pointing straight up (ie, the

Detect user activity (running, cycling, driving) using Android

試著忘記壹切 提交于 2019-12-20 09:20:50
问题 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 algorithms I should use to differentiate between these activities. I know I would have to use the accelerometer sensor. But still I can't differentiate these activities. 回答1: You can use the GooglePlayServices for this. It Provides special apis for ActivityRecognition, which returns the User

Android get normalized acceleration

爱⌒轻易说出口 提交于 2019-12-19 06:50:09
问题 I wish to get the acceleration vector of an Android phone. The problem is, the accelerometer coordinates are relative to the phone's rotation. What I want is the "absolute" acceleration, i.e., it should return the same values whichever way the phone is facing. (I want to detect if a user that is skiing is sliding down a slope without using GPS. I also need to be able to differentiate sliding and going up the chairlift.) I can probably get those values by combining the accelerometer with the

Gyroscope vs Accelerometer?

旧时模样 提交于 2019-12-18 10:26:43
问题 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? 回答1: A MEMs gyroscope is a rate of change device. As the device rotates in any its axis, you can see a change in rotation. An accelerometer only provides the force along the X,Y,and Z vectors, and cannot solve for "twist". By using both sensors, you can often implement what is referred to as a 6DOF (degrees of freedom) inertial

Using Android gyroscope instead of accelerometer. I find lots of bits and pieces, but no complete code

∥☆過路亽.° 提交于 2019-12-18 10:19:53
问题 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 also use a Kalman filter on the 3 orientation values, but that's too much code to show here. Ultimately, this works ok, but the result is either too jittery or too laggy depending on what I do with the results and how low I make the filtering factors. /** Just accelerometer and magnetic sensors */

How to get the euler-angles from the rotation vector (Sensor.TYPE_ROTATION_VECTOR)

风流意气都作罢 提交于 2019-12-18 04:55:37
问题 I rotated my android device in x direction (from -180 degree to 180 degree), see image below. And I assume only Rotation vector x value is changed. Y and z maybe have some noise, but it should be not much difference among the values. However, I receive this. Kindly see https://docs.google.com/spreadsheets/d/1ZLoSKI8XNjI1v4exaXxsuMtzP0qWTP5Uu4C3YTwnsKo/edit?usp=sharing I suspect my sensor has some problem. Any idea? Thank you very much. Jimmy 回答1: Your sensor is fine. Well, the rotation vector

How to enable gyroscope camera at current device orientation

微笑、不失礼 提交于 2019-12-17 16:54:19
问题 I would like to enable gyro controlled camera onButtonClick event but I want it to start at the camera's current position. Currently when the gyro gets enabled it moves the camera off to a new position (probably the devices current gyro rotation) rather than leaving it where it is and gyro-ing from that point. Hope I'm making sense, but basically I don't want the user to notice any change in what they are seeing in the game (ie. camera controlled by gyro but not that user would notice that

Detecting iOS orientation change instantly

为君一笑 提交于 2019-12-17 10:12:08
问题 I have a game in which the orientation of the device affects the state of the game. The user must quickly switch between Landscape, Portrait, and Reverse Landscape orientations. So far I've been registering the game for orientation notifications via: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; But it is far too slow - there seems to be about a second delay between rotating the phone and the notification actually being fired. I need a way to INSTANTLY detect

onSensorChanged() not calling for Gyroscope Sensor

。_饼干妹妹 提交于 2019-12-13 05:02:14
问题 I'll preface this with saying I am completely new to Android development. Started this week kind of thing. So far, I only know how to do forms with textboxes/buttons/that kind of thing. Graphical programming in Android is voodoo to me, still, so I'm trying to learn via tutorials and sample code. (which I tried asking for before posting this question but got utterly destroyed on downvotes, so I'll try this approach instead). I'm trying to learn how to make a bubble level. I ran across the

Should i use Accelerometer or Gyroscope to measure angle of the z-axis

偶尔善良 提交于 2019-12-12 12:29:51
问题 I am writing an An app in Android that needs to know the angle the rear camera is pointing with respect to the horizon and not with respect to it's last position. All of the definitions i have read for the compass and accelerometer don't say that i can do this. Is it at all possible to do this ? 回答1: You should use the Accelerometer. The idea is the following, in a static camera, the only force (which is seen by the accelerometer) acting on the camera is gravity. This should be able to give