Expose the GravitySensor API, which provides a 3-axis reading of the gravity force, to users.

Motivation

A gravity sensor is used to measure the force of gravity around the x, y, z axes. As https://crbug.com/1163993 states, it is already possible for users to manually derive readings close to a GravitySensor’s by manually inspecting an Accelerometer and a LinearAccelerometer’s readings, but this can be cumbersome and depend on the accuracy of the values provided by those sensors. Platforms such as Android can provide gravity readings as part of the platform, which should be cheaper in terms of computation, provide more accurate values depending on the user’s hardware and easier to use in terms of API ergonomics.

Specification

Editor's draft

Status in Chromium

Blink>Sensor


In developer trial (Behind a flag) (tracking bug) in:

  • Chrome for desktop release 90
  • Chrome for Android release 90

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Negative
  • No signal
  • Negative
  • Positive

Owners

Comments

One can also manually derive a GravitySensor's readings by removing a LinearAccelerometer's readings from an Accelerometer's.

Search tags

sensors, gravity, fugu,

Last updated on 2021-02-17