Ahh, you are right, HTC has it reversed. The Y value needs to be negated for both the accelerometer and compass to align with the documentation:
A constant describing an accelerometer. Sensor values are acceleration in the X, Y and Z axis, where the X axis has positive direction toward the right side of the device, the Y axis has positive direction toward the top of the device and the Z axis has positive direction toward the front of the device. The direction of the force of gravity is indicated by acceleration values in the X, Y and Z axes. The typical case where the device is flat relative to the surface of the Earth appears as -STANDARD_GRAVITY in the Z axis and X and Z values close to zero. Acceleration values are given in SI units (m/s^2) On Dec 3, 10:44 am, Koush <[EMAIL PROTECTED]> wrote: > That actually sounds like it is working properly. > > On the G1 accelerometer, (and all other HTC devices), the positive Z > axis is face up, the positive X axis is from the center of the screen > to the right, and the positive y axis is from the center of the screen > to the mouthpiece. > > Hence, if you are pointing the display with the earpiece to the north, > I would expect to see a negative Y value. > > I actually wrote a Sensor API for the Windows Mobile line of phones, > and one of the things I needed to do with the HTC implementation of > their sensor vector was to reverse the Y axis so that positive Y > points is in the direction of the earpiece. > > http://www.koushikdutta.com/2008/07/using-htc-touch-diamond-sensor-sd... > > On Dec 3, 7:05 am, Jean-Baptiste Queru <[EMAIL PROTECTED]> wrote: > > > There are quite a few significant issues with the sensor API as it > > currently exists in the G1, where many aspects were too loosely > > defined, and where there are a few bugs. > > > A later version of the Android API is expected to resolve those issues > > (and to provide backward-compatibility with the current API). > > > At this point your best bet is to modify your code based on what you > > see on the device until it does what you expect. I realize that's a > > sad recommendation, but it's pretty much the only realistic one. > > > JBQ > > > On Wed, Dec 3, 2008 at 7:00 AM, Ian <[EMAIL PROTECTED]> wrote: > > > > I'm trying to make sense of the SENSOR_MAGNETIC_FIELD sensor values on > > > the G1 phone. It looks to me like the X and Y values are pointing to > > > magnetic south, while the Z value is pointing north. In other words, > > > if I hold the phone with the earpiece end pointing north, I get a > > > negative Y value; if I hold it with the face of the display pointing > > > north, I get a positive Z value. > > > > Looking at the accelerometer X, Y and Z values, they behave as I > > > expect. > > > > Is anyone else seeing this, or am I missing something? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---