Rahul Raj
Rahul Raj

Reputation: 41

How to calculate G-force, Harsh Braking and Acceleration when I have 'x , y , z' data?

I have got raw data x, y, z but I don't know how to calculate G-force, Harsh Braking, and Acceleration. I am developing an app where I need to gather data of Harsh Braking, and Acceleration, So can you please help me to find a way to calculate.

Thanks

Here is my code :

constructor(props) {
    super(props);
    setUpdateIntervalForType(SensorTypes.accelerometer, 200);
    this.accelSubscription = accelerometer.subscribe(({x, y, z, timestamp}) => {
      this.setState({
        accel_x: x,
        accel_y: y,
        accel_z: z,
        time: timestamp,
      });

    });
    this.state = {
      acceleration: 0,
      accel_x: 0,
      accel_y: 0,
      accel_z: 0,
      time: 0,
      speed: 0,
    };
  }

Upvotes: 4

Views: 462

Answers (0)

Related Questions