react-native-griswold
TypeScript icon, indicating that this package has built-in type declarations

0.0.50 • Public • Published

image

React Native Griswold

NPM downloads NPM version

What is this?

react-native-griswold is specifically for the measurment of driving behaviours.

We do this by reading the device sensors (e.g. accelerometer values), and determine if a notable event has occured. If so, we send the event type, and values over the bridge to JS.

Installation

Run yarn add react-native-griswold in your project folder.

Usage

import {griswold} from 'react-native-griswold';


// setup listener within your component
useEffect(() => {
    const subscription = griswold.subscribe(event => {
      // Use values
      console.log('>>>>event: ', event);
    });

    return () => {
      subscription.unsubscribe();
    };
  }, []);

Event Types

  • HARD_BRAKE
  • SHARP_LEFT
  • SHARP_RIGHT

(to be continued...)

How are events determined?

The events are sent based on x,y,z values read from the accelerometer. The specific values are based on the thersholds measured and identified in the book "Beyond the Internet of Things".

image

Recognizing Driving Behaviour Using Smartphones Prokopis Vavouranakis, Spyros Panagiotakis, George Mastorakis, Constandinos X. Mavromoustakis and Jordi Mongay Batalla

Instructions for use in car

The phone must be placed flat, with the screen facing up. The device must be orientated in the same direction of the vehicle, i.e. the phone camera closer to the windscreen.

  • This limitation is temporary until we account for the device orientation in our calibration step and apply it to our accelerometer values.

Dependents (0)

Package Sidebar

Install

npm i react-native-griswold

Weekly Downloads

6

Version

0.0.50

License

MIT

Unpacked Size

278 kB

Total Files

75

Last publish

Collaborators

  • robertoconnor