{"action":"created","issue":{"url":"https://api.github.com/repos/immersive-web/cardboard-vr-display/issues/10","repository_url":"https://api.github.com/repos/immersive-web/cardboard-vr-display","labels_url":"https://api.github.com/repos/immersive-web/cardboard-vr-display/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/immersive-web/cardboard-vr-display/issues/10/comments","events_url":"https://api.github.com/repos/immersive-web/cardboard-vr-display/issues/10/events","html_url":"https://github.com/immersive-web/cardboard-vr-display/issues/10","id":285895374,"number":10,"title":"Update `FusionPoseSensor` to use new Sensor APIs (instead of `devicemotion`)","user":{"login":"cvan","id":203725,"avatar_url":"https://avatars0.githubusercontent.com/u/203725?v=4","gravatar_id":"","url":"https://api.github.com/users/cvan","html_url":"https://github.com/cvan","followers_url":"https://api.github.com/users/cvan/followers","following_url":"https://api.github.com/users/cvan/following{/other_user}","gists_url":"https://api.github.com/users/cvan/gists{/gist_id}","starred_url":"https://api.github.com/users/cvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvan/subscriptions","organizations_url":"https://api.github.com/users/cvan/orgs","repos_url":"https://api.github.com/users/cvan/repos","events_url":"https://api.github.com/users/cvan/events{/privacy}","received_events_url":"https://api.github.com/users/cvan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-01-04T06:48:54Z","updated_at":"2018-02-19T16:42:43Z","closed_at":"2018-01-22T17:50:55Z","author_association":"NONE","body":"The **`devicemotion`** API has been superseded by the **[Generic Sensor APIs](https://w3c.github.io/sensors/)**.\r\n\r\nIt's shipped in [Chrome for Android](https://www.chromestatus.com/features/5698781827825664). I tested on a Samsung Galaxy S8. Load **`chrome://flags/#enable-generic-sensor`**, and toggle the **`Generic Sensor`** flag from `Default` to **`Enabled`**.\r\n\r\nHere are some sample pages:\r\n\r\n- https://genericsensors.appspot.com/\r\n- https://sensors.glitch.me/\r\n\r\nThere is code in [`FusionPoseSensor`](https://github.com/googlevr/cardboard-vr-display/blob/5facde2/src/sensor-fusion/fusion-pose-sensor.js#L138-L179) that needs to use the new APIs when available (i.e., checking `if ('Sensor' in window) …`), and falling back to `devicemotion` only when necessary.\r\n\r\nSo instead of …\r\n\r\n```js\r\nwindow.addEventListener('devicemotion', event => {\r\n  console.log(event.accelerationIncludingGravity.x + ' m/s^2');\r\n});\r\n```\r\n\r\nlike this …\r\n\r\n```js\r\nlet sensor = new GravitySensor();\r\nsensor.start();\r\nsensor.addEventListener('reading', () => {\r\n  console.log(sensor.x + ' m/s^2');\r\n});\r\n```\r\n\r\nExamples:\r\n- https://w3c.github.io/accelerometer/#examples\r\n- https://w3c.github.io/accelerometer/#gravitysensor-interface\r\n- https://w3c.github.io/gyroscope/#examples\r\n- (WIP) https://github.com/cvan/webvr-polyfill/commit/645342\r\n"},"comment":{"url":"https://api.github.com/repos/immersive-web/cardboard-vr-display/issues/comments/366746628","html_url":"https://github.com/immersive-web/cardboard-vr-display/issues/10#issuecomment-366746628","issue_url":"https://api.github.com/repos/immersive-web/cardboard-vr-display/issues/10","id":366746628,"user":{"login":"jsantell","id":641267,"avatar_url":"https://avatars2.githubusercontent.com/u/641267?v=4","gravatar_id":"","url":"https://api.github.com/users/jsantell","html_url":"https://github.com/jsantell","followers_url":"https://api.github.com/users/jsantell/followers","following_url":"https://api.github.com/users/jsantell/following{/other_user}","gists_url":"https://api.github.com/users/jsantell/gists{/gist_id}","starred_url":"https://api.github.com/users/jsantell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsantell/subscriptions","organizations_url":"https://api.github.com/users/jsantell/orgs","repos_url":"https://api.github.com/users/jsantell/repos","events_url":"https://api.github.com/users/jsantell/events{/privacy}","received_events_url":"https://api.github.com/users/jsantell/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T16:42:43Z","updated_at":"2018-02-19T16:42:43Z","author_association":"COLLABORATOR","body":"@pozdnyakov great info, thanks! Looking through the spec and demos, is there anyway to distinguish the difference between Chrome m63-m65 implementations where `referenceFrame` is unsupported? Or to tell if `referenceFrame` will be respected?"}}
{"actor":{"display_login":"jsantell"}}