Hi. I have 2 main questions:

Question 1. Orientation Sensor return false values. Or my dev phone 1
broke?

The 'pitch' value skip between 70 to 110.

Please take a look at the log:

08-01 15:21:56.810: DEBUG/onSensorChanged(1605): Azimuth: 262.0,
Pitch: -72.0, Roll: -18.0
08-01 15:21:56.850: DEBUG/onSensorChanged(1605): Azimuth: 260.0,
Pitch: -73.0, Roll: -17.0
08-01 15:21:56.890: DEBUG/onSensorChanged(1605): Azimuth: 258.0,
Pitch: -74.0, Roll: -16.0
08-01 15:21:56.970: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -106.0, Roll: -16.0
08-01 15:21:57.010: DEBUG/onSensorChanged(1605): Azimuth: 256.0,
Pitch: -106.0, Roll: -15.0
08-01 15:21:57.050: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -105.0, Roll: -15.0
08-01 15:21:57.090: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -106.0, Roll: -15.0
08-01 15:21:57.130: DEBUG/onSensorChanged(1605): Azimuth: 258.0,
Pitch: -107.0, Roll: -15.0
08-01 15:21:57.170: DEBUG/onSensorChanged(1605): Azimuth: 259.0,
Pitch: -108.0, Roll: -16.0
08-01 15:21:57.210: DEBUG/onSensorChanged(1605): Azimuth: 261.0,
Pitch: -109.0, Roll: -17.0
08-01 15:21:57.260: DEBUG/onSensorChanged(1605): Azimuth: 260.0,
Pitch: -109.0, Roll: -18.0
08-01 15:21:57.310: DEBUG/onSensorChanged(1605): Azimuth: 258.0,
Pitch: -107.0, Roll: -17.0
08-01 15:21:57.360: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -106.0, Roll: -16.0
08-01 15:21:57.400: DEBUG/onSensorChanged(1605): Azimuth: 255.0,
Pitch: -75.0, Roll: -15.0
08-01 15:21:57.480: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -73.0, Roll: -16.0
08-01 15:21:57.600: DEBUG/onSensorChanged(1605): Azimuth: 258.0,
Pitch: -73.0, Roll: -16.0
08-01 15:21:57.640: DEBUG/onSensorChanged(1605): Azimuth: 256.0,
Pitch: -74.0, Roll: -15.0
08-01 15:21:57.680: DEBUG/onSensorChanged(1605): Azimuth: 258.0,
Pitch: -74.0, Roll: -15.0
08-01 15:21:57.720: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -75.0, Roll: -14.0
08-01 15:21:57.800: DEBUG/onSensorChanged(1605): Azimuth: 256.0,
Pitch: -75.0, Roll: -14.0
08-01 15:21:57.880: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -74.0, Roll: -15.0
08-01 15:21:57.960: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -75.0, Roll: -15.0
08-01 15:21:58.040: DEBUG/onSensorChanged(1605): Azimuth: 256.0,
Pitch: -76.0, Roll: -14.0
08-01 15:21:58.120: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -105.0, Roll: -15.0
08-01 15:21:58.170: DEBUG/onSensorChanged(1605): Azimuth: 256.0,
Pitch: -75.0, Roll: -15.0
08-01 15:21:58.210: DEBUG/onSensorChanged(1605): Azimuth: 258.0,
Pitch: -75.0, Roll: -15.0
08-01 15:21:58.250: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -105.0, Roll: -15.0
08-01 15:21:58.290: DEBUG/onSensorChanged(1605): Azimuth: 257.0,
Pitch: -104.0, Roll: -14.0
08-01 15:21:58.370: DEBUG/onSensorChanged(1605): Azimuth: 255.0,
Pitch: -105.0, Roll: -14.0
08-01 15:21:58.420: DEBUG/onSensorChanged(1605): Azimuth: 256.0,
Pitch: -105.0, Roll: -14.0

my code does nothing but to print out the values:
//
        public void onSensorChanged(SensorEvent event) {
                int type = event.sensor.getType();
                switch(type){
                        case Sensor.TYPE_ORIENTATION:
Log.d("onSensorChanged", "Azimuth: " + event.values[0] + ", Pitch: " +
event.values[1] + ", Roll: " + event.values[2]);
}
//


Question 2. How to get the "getRotationMatrix()" to work?

I read the SensorEvent docs and notice this:
"Note: It is preferable to use getRotationMatrix() in conjunction with
remapCoordinateSystem() and getOrientation()  to compute these values;
while it may be more expensive, it is usually more accurate."

So I think may be this can help me with my sensor problem in question
1.

So I tried using it and it always return false. (not successful and
nothing is filled in R[])

I made sure I give it correct set of parameters. (R[], I[],
valuesFromAccelSensor[], valuesFromMagneticSensor[])

I tried both 9 and 16 sizes arrays for both R and I. The method still
return false.

Thank you in advance! =)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to