Class: ProcessedSensors

ProcessedSensors

High-level abstraction that listen for raw sensors (accelerometers and gyroscopes) and apply a set of preprocessing / filtering on it.

The output is composed of 11 values:

  • IntensityNorm
  • IntensityNormBoost
  • BandPass AccX
  • BandPass AccY
  • BandPass AccZ
  • Orientation X (processed from acc and gyro)
  • Orientation Y (processed from acc and gyro)
  • Orientation Z (processed from acc and gyro)
  • gyro alpha (yaw)
  • gyro beta (pitch)
  • gyro gamma (roll)

Constructor

new ProcessedSensors()

Source:
Example
import { ProcessedSensors } from 'iml-motion';

const processedSensors = new ProcessedSensors();
processedSensors.addListener(data => console.log(data));
processedSensors
 .init()
 .then(() => processedSensors.start());

Methods

addListener(callback)

Add a listener to the module.

Parameters:
Name Type Description
callback ProcessedSensorsListener

Listener to register, the callback is executed with an array containing the processed data from the sensors

Source:

init()

Initialize the sensors

Source:
Returns:

Promise

removeListener(callback)

Remove a listener from the module.

Parameters:
Name Type Description
callback ProcessedSensorsListener

Listener to delete

Source:

start()

Start listening to the sensors

Source:

stop()

Stop listening to the sensors

Source: