DeviceOrientation Clarification

Hi,

I am currently working on implementing the DeviceOrientation Event
Specification <http://www.w3.org/TR/orientation-event/#deviceorientation>
for Chrome OS.

I wanted to get a clarification on one of the examples. The final example
in Section 2 Introduction:

A device is mounted in a vehicle, with the screen in a vertical plane, the
> top uppermost and facing the rear of the vehicle. The vehicle is travelling
> at speed v around a right-hand bend of radius r. The device records a
> positive x component for both acceleration and
> accelerationIncludingGravity. The device also records a negative value for
> rotationRate.gamma:

      {acceleration: {x: v^2/r, y: 0, z: 0},

       accelerationIncludingGravity: {x: v^2/r, y: 0, z: 9.81},

       rotationRate: {alpha: 0, beta: 0, gamma: -v/r*180/pi} };


>From the description of the device I would have expected that the gravity
component would be applied to the Y-axis. Giving
accelerationIncludingGravity: {x: v^2/r, y: 9.81, z: 0}. Is that a correct
interpretation?

Furthermore, while testing implementations of the API I have noticed a
discrepancy between the Chrome Android, and the Safari iOS implementations.
Currently Android orients gravity in the same manner as the specification,
with a flat device reporting accelerationIncludingGravity: {x: 0, y: 0, z:
9.81}. However I am seeing the gravity reversed with iOS, which reports
accelerationIncludingGravity: {x: 0, y: 0, z: -9.81}.

Currently I am planning to follow the specification and Android
implementations. I wanted to bring this up because the inconsistency could
make the API hard for web developers to use.

Please advise.

Regards,
Jonathan Ross

Received on Friday, 31 October 2014 23:16:20 UTC