The W3C Generic Sensor API is one of the latest proposed API, and defines a framework for exposing sensor data to the Open Web Platform in a consistent way. Google has just announced Chrome 67 beta supports the new API.
Four types of sensors are supported for now: accelerometer, gyroscope, orientation sensor combining accelerometer and gyroscope data, and motion sensor, another fusion sensor leveraging data from a magnetometer as well as the accelerometer and the gyroscope for example to act as a virtual compass.
You can test the Sensor API on your phone or other device with sensors running Chrome 67 beta or later using samples from Intel, or even customize them by editing the source code. The demo will require you to enable Generic Sensor and Generic Sensor Extra Classes in chrome://flags.
Such sensor API will be useful for extended / virtual reality applications, for example using the WebXR Device API enabling the creation of virtual and augmented reality experiences on mobile devices and desktops, and also implemented in Chrome 67 and up.
Firefox has a bug listed to implement the Generic Sensor API, but so far nobody has been assigned. However, it’s possible Firefox Reality browser will support it, as it’s been specifically designed for mixed reality applications.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
|Support CNX Software - Donate via PayPal or cryptocurrencies, become a Patron on Patreon, or buy review samples|