Android :: Bad Compass And Sensor Data

Jul 22, 2009

Am researching a problem with compass and sensor values returned by the phone. I found this thread: http://groups.google.com/group/android-developers/browse_thread/threa. Which seems related, but it's old so I'm starting a new one. I'm getting stuck values from both the compass and orientation sensors. It was fine yesterday, but today, I'm only getting values in a limited range (e.g. compass headings from 240 - 290), no matter how I orient the device. What's even more odd is that the radians returned from the call to Sensor Manager.get Orientation(), which returns radians, is giving consistently out of range values. Anyone see this same behavior, and if so, any fixes? Here's some sample sensor data. Format is heading, pitch, roll. The first set contains raw values, the second set contains values after I've applied the orientation matrix generated by the Sensor Manager. The third set contains values after I've smoothed the data with my own algorithm.

Android :: Bad compass and sensor data


Rotate Map Without Compass Sensor?

Mar 6, 2012

i develop an map application. One feature from my map is, it can rotate.I already develop map that can rotate using orientation sensor. But now, i need to develop it without sensor.So, it's possible to get an angle from 2 coordinates (last position and current position )with atan2 and use it to rotate the map ?

View 1 Replies View Related

Android :: How Do I Get Sensor Data On Mapoverlay?

Sep 14, 2010

since map overlay is not activity, how do i get the sensor data so that i can draw on the map overlay? like the direction arrow.

View 7 Replies View Related

Android :: Is It Possible To Get Sensor Data At Regular Intervals?

Aug 2, 2010

Just joined the Android group. I'm having problems with the acceleration and orientation sensors.I would like to obtain sensor data (acceleration and orientation values) at regular intervals (10 milliseconds). However, the SensorEventListener doesn't allow you to do that. Does anyone have an idea of how to work around this issue? This is important as I need it to collect data for an app I'm working on.

View 2 Replies View Related

Android :: Sensor Data Poll Mechanism

Jun 3, 2010

Per the current implementation in Sensor Manager, the SensorThread is polling data per below code, final int sensor = sensors_data_poll(values, status, timestamp); it then checks the sensor type if it is registered and processes the data further. For an application which has registered for only one sensor, still to get that particular sensor data, SensorThread has to execute for atleast N-1 loop most of the time. Can anybody provide the insight as to, why SensorThread is waiting to check the sensor type to be returned by the HAL instead of sending sensor information which is currently registered by that application. Wouldn't that increase the performance?

View 2 Replies View Related

Android :: Latency When Getting Sensor Data From Phone?

Mar 9, 2010

I am working on a project using HTC magic which requires the data from the electronic compass, including both the accelerometer and magnetic sensor. But I find that there is a significant latency between the move of the phone and the trigger of the sensorChanged event. In other word, the acceleration and magnetic data obtained from sensor are updated about half of a second after my motion. And I have several questions about the problem as follow. Are the orientation data computed by the acceleration and magnetic data? Or are there a physical sensor for orientation? Does the latency result from the android API (using the event) or the physical limitation of the electronic compass? It is said that the model of the electronic compass is AK8976A from Asahi Kasei. Does anybody have the datasheet or know the frequency of the sampling? Any idea to improve the real-time experience?

View 1 Replies View Related

Android :: Streaming Sensor Data From Device To A Server

Feb 16, 2010

I would like to continuously send/stream sensor data (GPS, acceleration, etc.) from a device to a server. What would be the best technology to do this? Is it possible to use RTSP? What else would you recommend me to use?

View 3 Replies View Related

Motorola :: Writing Android Sensor Data To XML File

Nov 9, 2010

I am developing an application that read data from sensors and write those data to an XML file when you press a key. i have 2 activity one for button and another is an Activity who implements sensorEventListener. the problem is my main activity is button and couldn't get data from event listener activity. i think the listener activity is not active but when i create an intent and start activity with that intent the program stop working. the button is able to create XML file solely.so how could i read sensor data from sensors,and how to send them to XML file when the button got clicks.

View 1 Replies View Related

Android : Collect Sensor Data While The Display Is Turned Off?

Jun 7, 2010

I'm using Android 2.1 on a HTC Nexus One. I want to collect sensor data while the device is turned off.
By using android.app.Service this works well while the app is in the background but stops working when the display is turned off by the hardware button.

Is there a possibility to collect sensor data while the display is turned off?

View 3 Replies View Related

Android :: How To Use OnSensor Changed Sensor Data In Combination With OpenGL?

Nov 24, 2010

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 opengl view or any other target which would need it. method 1 to 4 are working, they are directly sending the rotationMatrix to the OpenGl view. method 6 works now too, but i have no explanation why the rotation has to be done y x z.. all other methods are not working or buggy and i hope someone knows to get them working. i think the best method would be method 5 if it would work, because it would be the easiest to understand but i'm not sure how efficient it is. the complete code isn't optimized so i recommend to not use it as it is in your project. Code...

View 1 Replies View Related

Android :: No Light Sensor / Proximity Sensor Detected On Hero?

Feb 8, 2010

I have a HTC Hero here, and when I tried to get the list of available sensors on the device by calling ((SensorManager) getSystemService (Context.SENSOR_SERVICE)) .getSensorList(Sensor.TYPE_ALL); I get only the following sensors: D/SensorManager( 6302): found sensor: BMA150 3-axis Accelerometer, handle=0 D/SensorManager( 6302): found sensor: AK8973 3-axis Magnetic field sensor, handle=1 D/SensorManager( 6302): found sensor: AK8973 Orientation sensor, handle=2 D/SensorManager( 6302): found sensor: AK8973 Temperature sensor, handle=3 According to the specs, there should be a light and a proximity sensor on the Hero, and I've seen it in action (the automatic screen brightness adjustment) - so at least the ambient light sensor is definitely there. My question is then, why doesn't the getSensorList return for me the light and the proximity sensors?

View 8 Replies View Related

Android :: Difference Between Orientation Sensor / Magnetic Field Sensor

Nov 2, 2010

Does anyone know the difference between the orientation sensor and magnetic field sensor on Android?Since I've read that magnetometer is synonymous with digital compass I'm a little bit confused. What are they really?

View 1 Replies View Related

Android :: Is Orientation Sensor A Physical Sensor Different From Accelerometer?

Oct 30, 2009

Or it's just some virtual sensor the uses the data provided by the accelerometer and the magnetic field sensor to calculate the orientation?

View 7 Replies View Related

Android :: Add New Sensor Support In Sensor Framework

Nov 18, 2009

Can some one point towards any documentation/resources/ threads that can explain how a new sensor support can be added in android sensor framework?

View 2 Replies View Related

HTC Droid Eris :: My Home Sensor Is Not As Responsive As My Back Sensor

Feb 18, 2010

My home icon is way less responsive than the back icon which seems to be perfectly normal. Sometimes I have to "press" the home icon twice to get the "buzz" and have it move the screen. However the back icon works 99% of the time on the first press. IS there any adjustment I can make or should I bring the phone back. I have had it now for 2 weeks.

View 9 Replies View Related

Android :: Download - Compass App

Jan 7, 2010

I have the HTC hero right now with the Android 1.5 and was wondering if there is a compass app that i can download which is similar to the iPhone 3GS?

View 4 Replies View Related

Android :: Compass Still Crashing

Aug 12, 2009

I've modified the code a bit since the last time, and now it crashes at runtime. I've got the log-cat and code below. how to go about debugging.

CODE:..................

View 2 Replies View Related

Android :: Map With Compass Like Indicator

Aug 21, 2009

I'm trying to make a map with showing my location with an arrow that point to the way we are facing. the arraw image is something like this:

^ 0

Always pointing north, so i rotate it with sensor orientation event ( image.rotate(values[0]) )

I would like to ask if google map's north is always on 12 o'clock? because i try sometimes the arrow point to wrong direction. how to accurately make this thing works?

View 2 Replies View Related

Android :: Getting Compass Values And Use It On Map Overlay

Sep 13, 2010

I have a marker on the map using an Overlay. I also have access to the compass sensor which I'm able to show a textView with the orientation values (0 to 359). How can I apply this values to the marker? (which is a drawable). I already have a MAtrix created but when I insert the orientation value gives me an error, here it is:

GeoPoint geopoint = new GeoPoint((int) (newLocation.getLatitude() * 1E6),
(int) (newLocation.getLongitude() * 1E6)); Paint paint = new Paint();
Point pt = new Point(); mapView.getProjection().toPixels(geopoint, pt);
Bitmap bmp = BitmapFactory.decodeResource(getResources(),R.drawable.user2);
Matrix matrix = new Matrix(); matrix.postTranslate(-25, -25);
matrix.postRotate(direction); matrix.postTranslate(pt.x, pt.y);
paint.setAntiAlias(true); paint.setFilterBitmap(true);
int width = bmp.getWidth(); int height = bmp.getHeight();
Bitmap changedBitmap = Bitmap.createBitmap(bmp, 0, 0, width, height, matrix, true);
BitmapDrawable icon = new BitmapDrawable(changedBitmap);
icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
userOverlay useroverlay = new userOverlay(icon); useroverlay.addItem(item);
mapView.getOverlays().add(useroverlay);

I used the value retrieved from the sensor on "direction" but it doesn't work.

View 5 Replies View Related

Android :: Want To Test Compass App On Emulator

Mar 4, 2010

I want to test a compass app on the emulator. Is this possible or do i have to use a real device. Also I do not want to use gps.

View 2 Replies View Related

Android :: Google Skymap Reversed Compass?

Nov 2, 2009

I just installed google sky map and started it up all excited and I just don't get it. I have searched this forum and done google searches and no-one seems to have my issue so I think its something I am not getting but I cant see what it is. I fire up the app and it looks good.. but... the map on the screen goes in the opposite direction. As I rotate left the stars on the screen move left and as I rotate right the move right. up and down movements are fine.

When I point north or south it is correct but as I rotate the horizon says east when I point it west and west when I point it east.? I have recalibrated my compass.. When I run the compass app it works correctly.. even google maps in street view works correctly. It is only google sky map that seems to have reversed east and west. Has anyone else seen this? Is it just me being dumb?

View 4 Replies View Related

Android :: Create Aircraft Mounted Liked Compass?

Oct 31, 2010

I want to create a non-generic compass that uses rotating directions instead of a rotating needle as in the conventional compass. The drawing is like the illustration below..................

View 14 Replies View Related

Android :: Implement The Compass Function To Application

Jun 5, 2009

How can I implement the Compass function having 2 geopoints (start and destination)?

View 10 Replies View Related

Android :: Way To Get Bearing To Update Using Hardware Compass / Not?

Jun 4, 2010

I can't find much information out there on Android's hardware compass. I keep trying to setup my criteria to force Android to use the hardware compass. Basically my problem is I want the bearing to update even while the device is stationary. From my understanding the GPS will only update your bearing when your moving. I'd like bearing to update regardless if your moving or not. I've tried tricking the device in to thinking it's moving by setting the speed at a constant 10 but the bearing returns 0.0 always. My device for testing (currently) is a HTC tattoo. It has a compass so that's not the problem. So my question is, is there a way to get the bearing to update using hardware compass or not? regardless if your moving or not?

View 1 Replies View Related

Android :: Finding Direction Using Compass Interface

Jan 11, 2010

I need to know if there is an interface to access the direction in which the phone is pointing.

View 2 Replies View Related

Android :: Compass Pointing Direction Other Than North

Sep 16, 2010

I'm trying to implement something that I don't even know if it's possible. So I have this class which implements a SensorEventListener like this:
private SensorEventListener mySensorEventListener = new SensorEventListener(){
@Override public void onAccuracyChanged(Sensor sensor, int accuracy) {
} @Override public void onSensorChanged(SensorEvent event) {
myCompass.updateDirection((float)event.values[0]); } };

And a class that handles the way the compass looks like this:
public static class compassLook extends View {
private Paint paintPointer = new Paint(Paint.ANTI_ALIAS_FLAG);
private Paint paintCircle = new Paint(Paint.ANTI_ALIAS_FLAG);
private Paint paintLeters = new Paint(Paint.ANTI_ALIAS_FLAG);
private boolean firstDraw; private float direction = 0 ;
public compassLook(Context context) { super(context); init();
} public compassLook(Context context, AttributeSet attrs) { super(context, attrs); init();
} public compassLook(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle); init(); } private void init(){
paintPointer.setStyle(Paint.Style.STROKE); paintPointer.setStrokeWidth(3);
paintPointer.setColor(Color.argb(255, 209, 114, 2)); paintCircle.setStyle(Paint.Style.STROKE);
paintCircle.setStrokeWidth(2); paintCircle.setColor(Color.argb(150, 255, 255, 255));
paintLeters.setStyle(Paint.Style.STROKE); paintLeters.setStrokeWidth(1);
paintLeters.setColor(Color.argb(230, 255, 255, 255)); paintLeters.setTextSize(12);
firstDraw = true; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
MeasureSpec.getSize(heightMeasureSpec)); } @Override protected void onDraw(Canvas canvas) {
int cxCompass = (getMeasuredWidth()/2); int cyCompass = (getMeasuredHeight()/2);
float radiusCompass; if(cxCompass > cyCompass){ radiusCompass = (float) (cyCompass * 0.9);
} else{ radiusCompass = (float) (cxCompass * 0.9);}
canvas.drawCircle(cxCompass-50, cyCompass, radiusCompass, paintCircle);
if(!firstDraw){ // Desenho da linha que aponta canvas.drawLine(cxCompass-50, cyCompass,
(float)(cxCompass-50 + radiusCompass * Math.sin((double)(- direction) * 3.14/180)),
(float)(cyCompass - radiusCompass * Math.cos((double)(-direction) * 3.14/180)),
paintPointer); double mLatitude = (mLocation.getLatitude() / 1E6);
// I get this value from a LM request double mLongitude = (mLocation.getLongitude() / 1E6);
// I get this value from a LM request double picLatitude= Double.parseDouble(picLatitudeString);
// I get this value from a bundle double picLongitude = Double.parseDouble(picLongitudeString);
// I get this value from a bundle float direction = (float)
Math.toDegrees(Math.atan2(picLongitude- mLongitude, picLatitude-mLatitude));
float distancia = (float) (Math.sqrt(Math.pow(mLatitude- picLatitude,
2) + Math.pow(mLongitude-picLongitude,2)))/2;
//Desenho do texto que indica a distancia
canvas.drawText(String.valueOf(distancia) + "Km", cxCompass-30,
cyCompass+20, paintLeters); } } public void updateDirection(float dir)
{ firstDraw = false; direction = dir; invalidate(); } }

View 5 Replies View Related

Android :: Not Accurate - Build Compass For My Application

May 4, 2010

I need to build compass for my application.

From reading the documentation it seems there are two reasonable ways of doing this:

Sensor.TYPE_ORIENTATION method: This is the easy way of doing it. The problem with this is it is not accurate. When I compare my reading with Snaptic Compass it is about 10-15 degress off which for my purposes is unacceptable.

Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_MAGNETIC_FIELD and getRotationMatrix() in conjunction with remapCoordinateSystem() and getOrientation() method: The documentation says this "is usually more accurate". The problem is regardless of the delay I register with listener the compass goes crazy even when the device is stationary on flat surface.

View 2 Replies View Related

Android :: Accuracy Of Sensors Such As Electronic Compass

Mar 19, 2009

I am now beginning an app which will use the compass and tilt sensors to determine a persons heading and line of sight. Can I assume the sensors on devices such as the G1 are fairly accurate or can I expect to run into problems such as the compass being 5-10 degress off etc?

View 4 Replies View Related

Android :: Market Filtering For Accelerometer Or Compass?

Sep 4, 2010

I just read the developer blog post about non-phone Android devices such as tablets and GoogleTV - http://android-developers.blogspot.com/2010/09/brace-for-future.html.

I'm writing an accelerometer-based game and would like to filter for devices that have an accelerometer (or orientation sensor). Is there a way to do that? It would also be useful to filter for devices with a compass or GPS receiver.

View 2 Replies View Related

Android :: Best Phone Orientation For Compass Readings?

Dec 26, 2009

I've noticed that I get a slightly different reading from the compass depending on how I hold the phone. If I hold it vertically, its different than when I hold it horizontal (ie parallel to a table or floor). Does anyone know the most accurate way to hold the phone for the compass?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved