Giter VIP home page Giter VIP logo

generic-sensor-demos's Introduction

Demos for Generic Sensor API

This repository contains applications that demonstrate how to use the Generic Sensor API.

The Generic Sensor API is a set of interfaces which expose sensor devices to the web platform. The API consists of the base Sensor interface and a set of concrete sensor classes built on top, such as Accelerometer, LinearAccelerationSensor, Gyroscope, AbsoluteOrientationSensor and RelativeOrientationSensor.

The Generic Sensor API is very simple and easy-to-use! The Sensor interface has start() and stop() methods to control sensor state and several event handlers for receiving notifications about sensor activation, errors and newly available readings. The concrete sensor classes usually add their specific reading attributes to the base class.

Launch instructions

The demo apps work with Chrome 63 or later. If you have an older version of Chrome, please enable the chrome://flags/#enable-generic-sensor flag, before running the demos.

If the demo is using environmental sensors, such as, Magnetometer or AmbientLightSensor, please also enable chrome://flags/#enable-generic-sensor-extra-classes flag.

You could run demos from GitHub Pages for this repository.

Demos description

Punchmeter is a simple application that calculates user's punch speed using LinearAcceleration sensor. To try it the user should make a punch holding mobile device in his/her hand.

Punchmeter demo


This simple demo illustrates how an absolute orientation sensor can be used to modify rotation quaternion of a 3D model. The model is a three.js Object3D class instance that has quaternion property.

Orientation sensor demo


The demo presents a 360 degree panorama view of a beach with an added sound effect. The user can look around the scene by moving their device. The demo uses the orientation sensor to enable the user to look around.

360 Panorama


This demo presents a 360 degree video that the user can look around by moving their device. The user can also play the video in both forward and reverse by holding the device and walking forward and backward, respectively. The demo uses the orientation sensor to enable the user to look around and the accelerometer for walking detection to enable the user to control video playback by walking.


This web application demonstrates how Ambient light sensor can be used to control style of a map widget. When ambient illuminance level is less than 10 lumen, night mode style will be used.

Note: this demo requires chrome://flags/#enable-generic-sensor-extra-classes flag set.

Ambient Map demo


This web application presents information about device sensors and their reading values.

Note: this demo requires chrome://flags/#enable-generic-sensor-extra-classes flag set.

Sensor Info demo


This web application demonstrates how Magnetometer sensor can be used to provide user input for WebVR content. If you have VR enclosure with magnet button, you can interact with objects in the scene by sliding button down.

Note: this demo requires chrome://flags/#enable-generic-sensor-extra-classes flag set.

VR Button demo


This web application allows to test functionality of the sensors, correctness of their models in correspondence with respective specification.

Note: this demo requires chrome://flags/#enable-generic-sensor-extra-classes flag set.

Sensor tester

Development environment

If you would like to modify the existing code and experiment with the sensors API your code must be hosted on a web server that supports HTTPS. The simplest way is to fork this repository and enable GitHub Pages for your fork. Alternatevely, you can serve your web application locally, for this, we recommend to use Web Server for Chrome. If you are developing for mobile devices,set up port forwarding for your local server, and you are good to go!

Reporting a security issue

If you have information about a security issue or vulnerability with an Intel-maintained open source project on https://github.com/intel, please send an e-mail to [email protected]. Encrypt sensitive information using our PGP public key. For issues related to Intel products, please visit https://security-center.intel.com.

generic-sensor-demos's People

Contributors

adriancampos avatar anssiko avatar bleederi avatar cmumford avatar honry avatar kenchris avatar orenshalev avatar rakuco avatar rdower avatar xiuqijix avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.