sensor

Box2D: How to get the position of a sensor?

我怕爱的太早我们不能终老 提交于 2020-01-06 16:50:50
问题 Edit I've updated this question here: Box2D: How to get the position of a static body? I'm using sensors in a Box2D project. On a collision with a sensor, I'd like to know the sensor's position in the world. I'm detecting the collision with a contact listener, but the sensor's position is always 0 0. From my code: (edit, added the whole class) public class MyContactListener extends b2ContactListener { public var onSensorEvent:Function; override public function BeginContact(contact:b2Contact)

Android sensor listener does not get unregistered or sensor still retrieves values

久未见 提交于 2020-01-03 17:40:47
问题 I have some problems with SensorManager.unregisterListener. They are similar with Android, Thread, Cannot unregister SensorEventListener and SensorEventListener doesn't get unregistered with unregisterListener() method. But I could not find my answer! I also followed SensorManager documentation example http://developer.android.com/reference/android/hardware/SensorManager.html#SENSOR_DELAY_UI. The problem is that after the Activity is finished I unregister the listener but the sensor keeps

Android: How does one deal with inaccurate baromters?

孤人 提交于 2020-01-03 17:26:10
问题 I have been using a Samsung Galaxy S3 to work on an app that uses the barometer estimate the user's altitude. I use SensorManager.getAltitude(p0, p), and set p0 equal to the sea-level pressure reported at the nearest airport. I set p equal to the value returned by the barometer. Unfortunately, the altitude returned is systematically 20 meters or so higher than what it actually is. I'm certain that the barometer is returning pressure values that are too low, so SensorManager.getAltitude is

Android Convert device coordinate system to “user” coordinate system

痴心易碎 提交于 2020-01-03 12:26:29
问题 My question is similar to Changing sensor coordinate system in android I want to be able to compare a user's movements with each other regardless of device orientation. So that when the users holds out the phone in portrait orientation and bends his arm, acceleration readings are the same as when he holds out his phone in landscape and then bends his arm in the same direction. This is what I call the "user" coordinate system. It is different from the world coordinate system since it should

Changing sensor coordinate system in android

≡放荡痞女 提交于 2020-01-03 06:33:41
问题 Android provides sensor data in device coordinate system no matter how it is oriented. Is there any way to have sensor data in 'gravity' coordinate system? I mean no matter how the device is oriented I want accelerometer data and orientation in coordinate system where y-axis points toward the sky, x-axis toward the east and z-axis towards south pole. I took a look at remapCoordinateSystem but seems to be limited to only swapping axis. I guess for orientation I will have to do some low level

Android compass issue

随声附和 提交于 2020-01-03 05:28:08
问题 SO im trying to make a App that tracks which direction the phone is pointed VIA the compass and once a button is hit on the screen it displays the number of where it is pointed in degrees. So far i understand how the compass is created but can not find which values are the pointed direction in relation to North. Here is what i have so far. public class compass extends Activity implements OnClickListener, SensorEventListener{ private final SensorManager DirPoint; float var; TextView theNumber;

Azimuth values changing when changing pitch

萝らか妹 提交于 2020-01-03 05:23:31
问题 I need the device's azimuth and roll values for an augmented reality app I'm working on. I'm getting the rotation matrix - from getRotationMatrix - using the accelerometer and the magnetic field. Since this is an AR app, I need to render objects that wouldn't change their positions in the real world (when seen through the camera) when the device is moved. The problem is, when physically rolling the device (in attempts to observe the variations in the pitch values), I can observe changes in

Azimuth values changing when changing pitch

为君一笑 提交于 2020-01-03 05:23:12
问题 I need the device's azimuth and roll values for an augmented reality app I'm working on. I'm getting the rotation matrix - from getRotationMatrix - using the accelerometer and the magnetic field. Since this is an AR app, I need to render objects that wouldn't change their positions in the real world (when seen through the camera) when the device is moved. The problem is, when physically rolling the device (in attempts to observe the variations in the pitch values), I can observe changes in

DHT22 Sensor import Adafruit_DHT error

寵の児 提交于 2020-01-02 04:50:48
问题 So I've properly attached DHT22 Humidity Sensor to my BeagleBone Black Rev C. I'm running OS Mavericks on my MacBook Pro and I followed the directions provided by Adafruit on how to use my DHT22 The website I used was pretty clear: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/software-install-updated Also here is the github files I cloned: https://github.com/adafruit/Adafruit_Python_DHT I put in these lines: git clone https://github.com/adafruit/Adafruit

SensorTag 2 CC2650 advertising indefinately firmware

这一生的挚爱 提交于 2020-01-02 03:48:04
问题 I want to use a SensorTag 2 so that it is sitting there broadcasting it's data (and, critically connectable over bluetooth) from when it's turned on to when\if I ever turn it off. Out of the box, the tag is set to only advertise over Bluetooth for a few mins which means that when the connection eventually fails or when the device connected to the tag boots etc etc you can't connect again without physically visiting the tag and resetting it. I see there is firmware that the myWeatherCenter