Intent to implement Accelerometer, Gyroscope and Magnetometer Sensor APIs

404 views
Skip to first unread message

Alexander

unread,
Aug 31, 2016, 5:51:52 AM8/31/16
to blink-dev, Anssi Kostiainen

Contact emails


alexander...@intel.com, mikhail.p...@intel.com, rijubrat...@intel.com


Specs


Accelerometer Sensor API https://w3c.github.io/accelerometer/

Gyroscope Sensor API https://w3c.github.io/gyroscope/

Magnetometer Sensor API https://w3c.github.io/magnetometer/


Summary


These three sensor APIs are combined together in one request as input from them allows to determine device motion and orientation. Each of them extends Generic Sensor API [1] therefore implementation of Accelerometer, Gyroscope and Magnetometer sensor APIs will use Generic Sensors Framework (GSF) [2].


Motivation


Accelerometer, Gyroscope and Magnetometer sensor APIs provide simple interfaces for web developers, yet allow to fuse sensor data to implement complex functionality such as device motion and orientation.

The GSF implementation is being upstreamed and now partially landed in Chromium.

Adding of a new sensor support to GSF is easy and requires just a small amount of code to be added (basically new JS bindings) since GSF already does most of the work.


Interoperability and Compatibility Risk


Low, since this is the first implementation of the APIs.


Ongoing technical constraints


None.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?


Yes.

Mac (only accelerometer).


OWP launch tracking bug

Not yet created.


Link to entry on the feature dashboard

Not yet created.


Requesting approval to ship?


No.


[1] https://w3c.github.io/sensors

[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/TkfdVqYAYiE/4J7Z088MBAAJ

Rick Byers

unread,
Sep 1, 2016, 7:44:22 PM9/1/16
to Alexander, blink-dev, Anssi Kostiainen
I'm glad to see this progressing!  One little note:

On Wed, Aug 31, 2016 at 5:51 AM, Alexander <alexander...@intel.com> wrote:

Contact emails


alexander...@intel.com, mikhail.p...@intel.com, rijubrat...@intel.com


Specs


Accelerometer Sensor API https://w3c.github.io/accelerometer/

Gyroscope Sensor API https://w3c.github.io/gyroscope/

Magnetometer Sensor API https://w3c.github.io/magnetometer/


Summary


These three sensor APIs are combined together in one request as input from them allows to determine device motion and orientation. Each of them extends Generic Sensor API [1] therefore implementation of Accelerometer, Gyroscope and Magnetometer sensor APIs will use Generic Sensors Framework (GSF) [2].


Motivation


Accelerometer, Gyroscope and Magnetometer sensor APIs provide simple interfaces for web developers, yet allow to fuse sensor data to implement complex functionality such as device motion and orientation.

The GSF implementation is being upstreamed and now partially landed in Chromium.

Adding of a new sensor support to GSF is easy and requires just a small amount of code to be added (basically new JS bindings) since GSF already does most of the work.


Interoperability and Compatibility Risk


Low, since this is the first implementation of the APIs.


It's true the compat risk is low, but being the first implementation of a new API makes it high interop risk.  It's not a big deal now at implementation time, but by the time you're ready for an "intent to ship" expect to be able to describe the level of interest from other browser vendors.  What data do we have to suggest this API is likely to eventually be supported consistently by all major browsers?

Kostiainen, Anssi

unread,
Sep 2, 2016, 4:32:49 AM9/2/16
to Rick Byers, Shalamov, Alexander, blink-dev
On 02 Sep 2016, at 02:43, Rick Byers <rby...@chromium.org> wrote:

I'm glad to see this progressing!  One little note:

On Wed, Aug 31, 2016 at 5:51 AM, Alexander <alexander...@intel.com> wrote:
Contact emails


Specs

Accelerometer Sensor API https://w3c.github.io/accelerometer/
Magnetometer Sensor API https://w3c.github.io/magnetometer/

Summary

These three sensor APIs are combined together in one request as input from them allows to determine device motion and orientation. Each of them extends Generic Sensor API [1] therefore implementation of Accelerometer, Gyroscope and Magnetometer sensor APIs will use Generic Sensors Framework (GSF) [2].

Motivation

Accelerometer, Gyroscope and Magnetometer sensor APIs provide simple interfaces for web developers, yet allow to fuse sensor data to implement complex functionality such as device motion and orientation.
The GSF implementation is being upstreamed and now partially landed in Chromium.
Adding of a new sensor support to GSF is easy and requires just a small amount of code to be added (basically new JS bindings) since GSF already does most of the work.

Interoperability and Compatibility Risk

Low, since this is the first implementation of the APIs.

It's true the compat risk is low, but being the first implementation of a new API makes it high interop risk.  It's not a big deal now at implementation time, but by the time you're ready for an "intent to ship" expect to be able to describe the level of interest from other browser vendors.  What data do we have to suggest this API is likely to eventually be supported consistently by all major browsers?

The Generic Sensor API spec work was triggered by Mozilla reporting the following issue against the old events-based API (design similar to the DeviceOrientationEvent):


Given this background, my expectation is Mozilla will implement the new API. They're in the W3C Device and Sensors WG, and have been reviewing the new sensor specs and providing helpful feedback along the way.

In addition to Mozilla, another major browser vendor has indicated interest to implement, but since I can't speak on behalf of them, I'll let them announce support themselves.

Ongoing technical constraints

None.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.
Mac (only accelerometer).

OWP launch tracking bug
Not yet created.

Link to entry on the feature dashboard
Not yet created.

Requesting approval to ship?

No.

[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/TkfdVqYAYiE/4J7Z088MBAAJ



--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

rek...@gmail.com

unread,
Sep 7, 2016, 9:03:18 PM9/7/16
to blink-dev, anssi.ko...@intel.com
Super exciting seeing that there's an intent to support this on a wide range of platforms. I finally poked around and found the sensors on my personal Dell that runs Linux, which was super cool to see. I'm over the moon that this Intent targets my platform and so many others!

Alexander

unread,
Dec 16, 2016, 4:32:33 AM12/16/16
to blink-dev, anssi.ko...@intel.com, Ilkka Syrjala

Update for implementation status of sensors based on Generic Sensor API.


Our team has implemented support for ambient light, accelerometer, gyroscope and magnetometer sensors. The new APIs can accessed by enabling “Generic Sensor” feature flag.


Demo apps that show how sensors can be used by web developers:


Map that changes style based on input from ambient light sensor (night | day mode).

https://ambientmap.appspot.com/

https://github.com/01org/websensor-ambient-map


Simple WebVR demo that demonstrates how magnetometer can be used to provide user input by triggering magnet button on VR enclosure.

https://vrbutton.appspot.com/

https://github.com/01org/websensor-vr-button


Marine compass demo that uses motion sensors.

https://sensor-compass.appspot.com

https://github.com/01org/websensor-compass


Simple demo app for testing sensors, observing reading values, state changes, etc.

https://github.com/01org/websensor-sensor-info

https://genericsensors.appspot.com/


ED Specs:

Generic Sensor API https://w3c.github.io/sensors/

Ambient Light Sensor API https://w3c.github.io/ambient-light/

PhistucK

unread,
Dec 16, 2016, 6:51:30 AM12/16/16
to Alexander, blink-dev, Anssi Kostiainen

On Wed, Aug 31, 2016 at 11:51 AM, Alexander <alexander...@intel.com> wrote:

Yes.

Mac (only accelerometer).


​Then, no.
So everything will be supported on all platforms, except for macOS.
macOS will only support the accelerometer.
Correct?​



PhistucK

Kenneth Rohde Christiansen

unread,
Dec 16, 2016, 9:38:34 AM12/16/16
to PhistucK, Alexander, blink-dev, Anssi Kostiainen
I believe that is the only one sensor supported by the hardware, ie many MacBooks support accelerometer because of the HD, or at least it used to be like that as that is not supported with SSDs if I recall correctly.

Kenneth

--
Message has been deleted

Mikhail Pozdnyakov

unread,
Mar 21, 2017, 4:51:22 AM3/21/17
to blink-dev, anssi.ko...@intel.com
Hi,

We would like to extend this intent with the AbsoluteOrientationSensor interface, a high-level motion sensor which fuses data from the three low-level motion sensors (Accelerometer, Gyroscope, Magnetometer which are already present in the intent) and exposes the device orientation data in a convenient ready-to-use way (quaternion, rotation matrix).
The AbsoluteOrientationSensor interface is specified at https://w3c.github.io/orientation-sensor/ .

Also please read the explainer document https://w3c.github.io/motion-sensors/, it describes low-level and high-level motion sensors (incl Absolute Orientation Sensor), their relationship, inner workings and common use-cases.

Link to entry on the feature dashboard:
https://www.chromestatus.com/features/5698781827825664

BR,
Mikhail

P.S. this is the copy of the previous post the original post has been deleted as it contained broken links

Vincent Scheib

unread,
Mar 21, 2017, 6:47:05 PM3/21/17
to Mikhail Pozdnyakov, blink-dev, Kostiainen, Anssi
Would you update the chromestatus entry with links to the specifications, please.

Alexis Menard

unread,
Mar 22, 2017, 12:12:35 PM3/22/17
to PhistucK, Alexander, blink-dev, Anssi Kostiainen
Only old macbook hardware ships with some kind of accelerometer. It's like a sudden motion sensor that was used to protect spinning disk against fall. There is no new Apple hardware shipping with that sensor for many years. I personally think that's it's not worth to implement the feature for macOS.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Mikhail Pozdnyakov

unread,
Mar 23, 2017, 7:00:32 AM3/23/17
to blink-dev, mikhail.p...@intel.com, anssi.ko...@intel.com
Hi Vincent,

The intended APIs are specified at different URLs, they are mentioned at  "Doc Links":
https://w3c.github.io/accelerometer/
https://w3c.github.io/gyroscope/
https://w3c.github.io/magnetometer/
https://w3c.github.io/orientation-sensor/

Unfortunately, it looks like the "Spec link:" field accepts only one URL.

BR,
Mikhail
Reply all
Reply to author
Forward
0 new messages