Did someone try the ionic native Gyroscope plugin ? I don’t succeed to make it work because of a typecript error that said there is not exported members ‘Gyroscope’.
Here is the line which doesn’t work:
import { Gyroscope } from ‘ionic-native’;
When I checked in the node_modules/ionic-native folder I couldn’t find the gyroscope folder. Do I need to do something special to make it work ?
This does not work for me as well, I did everything according to the tutorials available. I even tried alternative methods that used a global variable as described here: https://github.com/NeoLSN/cordova-plugin-gyroscope
This generates the numbers that changes every second as expected. But I am not able to make sense out of these numbers. They change frequently even when I lay the phone on a stationary table. I am trying to calculate the phone orientation with respect to the North (True or Magnetic). I am using camera preview want to make sure it point in landscape mode directly at the face level (not facing up or down). I want to show data only at the face level. How do I make use of these Gyroscope numbers in determining the phone orientation with respect to the x, y or z axis or calculate roll, pitch and yaw?
Main question, what does x, y and z represent? Are they angular velocities or directions by radians or what? Why do they change when my phone is stationary?
This article and that article should help you. Note that the raw data includes the effect of gravity. I’ve started using gyronorm and I find its representation more useful for my needs (I’m working on motion while driving a car)
Uncaught Error: Can't resolve all parameters for GyroNorm: (?).
at syntaxError (compiler.es5.js:1540)
at CompileMetadataResolver._getDependenciesMetadata (compiler.es5.js:14877)
at CompileMetadataResolver._getTypeMetadata (compiler.es5.js:14745)
at CompileMetadataResolver._getInjectableMetadata (compiler.es5.js:14731)
at CompileMetadataResolver.getProviderMetadata (compiler.es5.js:15021)
at compiler.es5.js:14950
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getProvidersMetadata (compiler.es5.js:14911)
at CompileMetadataResolver.getNgModuleMetadata (compiler.es5.js:14566)
at JitCompiler._loadModules (compiler.es5.js:25630)
Followed the steps:
$ npm install gyronorm
Updated the file index.html before the cordova script src reference. . Copied file gyronorm.complete.min.js to the location src/js/gyronorm.complete.min.js.
deleted node_modules and everything under www folder