Class: Orientation

Orientation

Filter that integrate gyrosscope and acceleration in order to remove noise from accelerometers data while keeping a good reactivity. The filter ouputs a normalized projection vector. Be aware that the out of the filter invert the x and z in regard of the device motion specification (left-hand axis). This is done for compatibility with the R-ioT sensor.

Constructor

new Orientation(optionsopt)

Parameters:
Name Type Attributes Description
options Object <optional>

Override default options.

Properties
Name Type Attributes Default Description
k Number <optional>
0.9

Ratio between the accelerometers and gyroscope. 1 means gyroscope only 0 mean accelerometers only (this is equivalent to a lowpass filter)

Source:
Example
import * as lfo from 'waves-lfo/client';
import * as lfoMotion from 'lfo-motion';

const motionInput = new lfoMotion.source.MotionInput();
const sampler = new lfoMotion.operator.Sampler({ frameRate: 50 });
const orientation = new lfoMotion.operator.Orientation();
const logger = new lfo.sink.Logger({ data: true });

motionInput.connect(sampler);
sampler.connect(orientation);
orientation.connect(logger);

motionInput.init().then(() => motionInput.start())