sensor

How to track position of an Android device in a building?

核能气质少年 提交于 2019-11-28 04:29:39
问题 I want to develop an application in which I need to know the position of my device within a building (the room in which the device currently is). GPS is not working in the building. Is there any way to find the position of the device in building? If yes how? Can i use position or motion sensors or combination of these for this purpose? 回答1: There is no general solution. In case you can place WiFi hotspots/repeaters in the building (preferably in every room), you can triangulate the position

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

一笑奈何 提交于 2019-11-28 04:23:07
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 gyroscope. So my questions are: Which Android phones do have a gyroscope? (Should be usable with the Android API's Sensor.TYPE_GYROSCOPE which is available since API 3) Which Android phones do have a 6-axis accelerometer? Any references like links, specs etc. are greatly appreciated and of

Different values between sensors TYPE_ACCELEROMETER/TYPE_MAGNETIC_FIELD and TYPE_ORIENTATION

孤人 提交于 2019-11-28 03:52:12
There are 2 ways to get the 3 rotation values (azimuth, pitch, roll). One is registering a listener of a type TYPE_ORIENTATION. It's the easiest way and I get a correct range of values from every rotation as the documentation says: azimuth: [0, 359] pitch: [-180, 180] roll: [-90, 90] The other one, the most precise and complex to understand the first time you see it. Android recommends it, so I want to use it, but I get different values. azimuth: [-180, 180]. -180/180 is S, 0 i N, 90 E and -90 W. pitch: [-90, 90]. 90 is 90, -90 is -90, 0 is 0 but -180/180 (lying with the screen downwards) is 0

How to use onSensorChanged sensor data in combination with OpenGL

放肆的年华 提交于 2019-11-28 02:57:05
( edit: I added the best working approach in my augmented reality framework and now also take the gyroscope into account which makes it much more stable again: DroidAR framework ) I have written a TestSuite to find out how to calculate the rotation angles from the data you get in SensorEventListener.onSensorChanged() . I really hope you can complete my solution to help people who will have the same problems like me. Here is the code, I think you will understand it after reading it. Feel free to change it, the main idea was to implement several methods to send the orientation angles to the

BLE gatttool cannot connect even though device is discoverable with hcitool lescan

两盒软妹~` 提交于 2019-11-27 20:07:29
问题 I'm running RPi with a USB Bluetooth dongle. When I use hcitool, I can discover the SmartTag device. But when I use gatttool, I cannot connect. It says "Host is down (112)". Here are my commands: $ sudo hcitool lescan LE Scan ... BC:6A:29:AB:DE:2B (unknown) BC:6A:29:AB:DE:2B SensorTag Checking for bluetooth adapters on my RPi I get: $ hcitool dev Devices: hci0 5C:F3:70:60:E6:1B Then, when I use the gatttool like this, I get: $ sudo gatttool -i hci0 -b BC:6A:29:AB:DE:2B -I [ ][BC:6A:29:AB:DE

Different values between sensors TYPE_ACCELEROMETER/TYPE_MAGNETIC_FIELD and TYPE_ORIENTATION

好久不见. 提交于 2019-11-27 19:15:00
问题 There are 2 ways to get the 3 rotation values (azimuth, pitch, roll). One is registering a listener of a type TYPE_ORIENTATION. It's the easiest way and I get a correct range of values from every rotation as the documentation says: azimuth: [0, 359] pitch: [-180, 180] roll: [-90, 90] The other one, the most precise and complex to understand the first time you see it. Android recommends it, so I want to use it, but I get different values. azimuth: [-180, 180]. -180/180 is S, 0 i N, 90 E and

Getting Direction Vector in Android

∥☆過路亽.° 提交于 2019-11-27 18:04:34
问题 How can I get a direction vector representing the direction the back of the device is pointing relative to earth coordinates? For example, if place down on a desk (screen facing up) it should read [0,0,-1] and if held vertically facing north it should read [1,0,0], etc. I know how to calculate it from heading, pitch, and roll, as long as those are relative to earth coordinates. To be clear here I am not looking for angular velocity, but the actual current angle relative to the plane tangent

How to use Kalman filter in Python for location data?

旧城冷巷雨未停 提交于 2019-11-27 17:21:21
[EDIT] The answer by @Claudio gives me a really good tip on how to filter out outliers. I do want to start using a Kalman filter on my data though. So I changed the example data below so that it has subtle variation noise which are not so extreme (which I see a lot as well). If anybody else could give me some direction on how to use PyKalman on my data that would be great. [/EDIT] For a robotics project I'm trying to track a kite in the air with a camera. I'm programming in Python and I pasted some noisy location results below (every item also has a datetime object included, but I left them

How to detect movement of an android device?

非 Y 不嫁゛ 提交于 2019-11-27 17:21:01
I need suggestion about how to detect the amount of movement of an android device. Suppose I have put the phone on a table or bed and then if somebody taps the table or sits or laydown on the bed then I want to detect the movement of the android device. Actually I know that android has motion sensors APIs but I don't know which sensor to use and what sensor type is best for this type of movement detection. I would be glad if someone can share some basic demo code. Definitely work with the accelerometer: // Start with some variables private SensorManager sensorMan; private Sensor accelerometer;

Is there a way to retrieve multiple sensor data in Android

徘徊边缘 提交于 2019-11-27 11:51:33
I'm trying to get both accelerometer and orientation data. Currently, I created an AccelerometerManager and OrientationManager. They both do the same thing; implement SensorEventListener and retrieve data from values[] in onSensorChanged() listeners. Is there an easier way to do this? It seems like having 2 handlers with duplicate code is uneccessary. Is there a way to access a values[] array with the combined accelerometer and orientation data together? Because of the 2 handlers, I'm also having to do this: orientationManager = new OrientationManager(this); orientationSensorManager =