New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug


Participants' hotlists:
Sensors


Sign in to add a comment
link

Issue 541607: devicemotion: rotationRate not implemented according to spec

Reported by i...@soaa.me, Oct 9 2015

Issue description

Steps to reproduce the problem:
1. On Chrome Mobile, go to https://jsfiddle.net/SrxtE/61/embedded/result/
2. Rotate the device around the axis perpendicular to the screen (Z axis)
3. See that 'gamma' is changing
4. Rotate the device around its shorter side to side axis (X axis)
5. See that 'alpha' is changing
6. Rotate the device around its longer top to bottom axis (Y axis)
7. See that 'beta' is changing
8. Notice that in all three cases, the numbers reported are fairly small (around -10..10)

What is the expected behavior?
According to the W3C spec (http://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion) the rotation axes should be the following:

Z axis: alpha
X axis: beta
Y axis: gamma

Furthermore, the rotation rate should be reported in deg/s, whereas in the current version of Chrome, the value is in rad/s.

What went wrong?
- The axes are not assigned correctly.
- The values are not scaled correctly.

Did this work before? No 

Chrome version: 47.0.2526.6  Channel: dev
OS Version: 5.1.1; SM-N910W8 Build/LMY47X
Flash Version:
 

Comment 1 by i...@soaa.me, Oct 9 2015

Woops. The arch here is arm-v7.

Comment 2 by ppolise...@chromium.org, Oct 9 2015

Cc: timvolod...@chromium.org klo...@chromium.org
Status: Available

Comment 3 by Deleted ...@, Oct 9 2015

Yeh questions prapt nahi kar Sakta isliye maine download kiya

Comment 4 by tkent@chromium.org, Oct 12 2015

Labels: -Cr-Blink-JavaScript Cr-Blink

Comment 5 by cbiesin...@chromium.org, Oct 26 2015

Cc: smus@chromium.org

Comment 6 by yosin@chromium.org, Apr 20 2016

Owner: lafo...@chromium.org
Status: Assigned (was: Available)
laforge@, please create component:Blink>DeviceOrientation like Blink>Bluetooth

Comment 7 by lafo...@chromium.org, May 30 2016

Status: Fixed (was: Assigned)
IO>DeviceOrientation created, IO>Bluetooth existed.

Comment 8 by timvolod...@chromium.org, May 31 2016

Cc: -timvolod...@chromium.org lafo...@chromium.org
Owner: timvolod...@chromium.org
Status: Assigned (was: Fixed)
thanks laforge@
looks like the rotation rate comment could still apply will need to double-check, assigning to myself

Comment 9 by timvolod...@chromium.org, May 31 2016

Components: IO>DeviceOrientation

Comment 10 by cbiesin...@chromium.org, Jun 28 2016

Components: -Blink

Comment 11 by reillyg@chromium.org, Apr 19 2017

Components: -IO>DeviceOrientation Blink>Sensor

Comment 12 by reillyg@chromium.org, May 12 2017

Components: -Blink>Sensor Blink>Sensor>DeviceOrientation

Comment 13 by reillyg@chromium.org, Aug 22 2017

Owner: juncai@chromium.org
Jun and I recently rediscovered this issue. It is an easy fix however we should do a survey of other implementations to be sure that this behavior has not become the de facto standard given that this has been wrong since this feature was first implemented 4.5 years ago.

Comment 14 by juncai@chromium.org, Aug 22 2017

I did some testing on Chrome on Android, Firefox browser on Android, and Safari browser on iPhone, they all use:
X axis: alpha
Y axis: beta
Z axis: gamma

The difference is that Firefox browser and Safari browser use degrees, and Chrome uses radians.

Comment 15 by juncai@chromium.org, Aug 25 2017

Status: Started (was: Assigned)

Comment 16 by juncai@chromium.org, Aug 25 2017

Cc: timvolod...@chromium.org

Comment 17 by juncai@chromium.org, Aug 31 2017

Some updates:
1. For the rotation axes issue, I filed a DeviceOrientation Event spec issue to update the spec and created a pull request:
https://github.com/w3c/deviceorientation/issues/44
https://github.com/w3c/deviceorientation/pull/43

2. For the rotation rate issue, I posted an "Intent to Change" to change Chrome implementation to use deg/s instead of rad/s at:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/ple1o7bFqEs

Comment 18 by bugdroid1@chromium.org, Jan 19 2018

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b86cf40509d59742d8917fde6d03fe195a7432d8

commit b86cf40509d59742d8917fde6d03fe195a7432d8
Author: Jun Cai <juncai@chromium.org>
Date: Fri Jan 19 17:29:02 2018

Change DeviceMotionEvent's DeviceRotationRate to use degrees

The DeviceMotionEvent spec:
https://w3c.github.io/deviceorientation/spec-source-orientation.html#devicemotion
says the DeviceMotionEvent's DeviceRotationRate "must be expressed in
degrees per second (deg/s)". This CL changes the implementation to be
the same as the spec.

Related post and discussion at blink-dev:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/ple1o7bFqEs

Bug:  541607 
Change-Id: I8cd5a8fadeebf49deb1126685d267495da7b4c3c
Reviewed-on: https://chromium-review.googlesource.com/658330
Commit-Queue: Jun Cai <juncai@chromium.org>
Reviewed-by: Tim Volodine <timvolodine@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530549}
[modify] https://crrev.com/b86cf40509d59742d8917fde6d03fe195a7432d8/content/renderer/device_sensors/device_motion_event_pump.cc
[modify] https://crrev.com/b86cf40509d59742d8917fde6d03fe195a7432d8/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
[modify] https://crrev.com/b86cf40509d59742d8917fde6d03fe195a7432d8/content/test/data/device_sensors/device_motion_only_some_sensors_are_available_test.html
[modify] https://crrev.com/b86cf40509d59742d8917fde6d03fe195a7432d8/content/test/data/device_sensors/device_motion_test.html

Comment 19 by juncai@chromium.org, Jan 19 2018

Status: Fixed (was: Started)

Sign in to add a comment