简体   繁体   中英

Android accelerometer sensor values

I'm playing with accelerometer sensor on Android Wear. When I'm reading the values in listener it gives me an array of for example [-19,594337 -19,594337 19,594337]. I mean, really? 19 m/s^2 in all dimensions? Bet Mike Tyson can't do better. Can anybody explain me, if I'm doing something wrong?

The code is just

public void onSensorChanged(SensorEvent event){ ... event.values ...}

for TYPE_LINEAR_ACCELERATION listener.

There's nothing wrong with outout. The output you got is called raw output of sensors. That means gravitational force is not excluded from the output of TYPE_LINEAR_ACCELERATION . You need to exclude it yourself.

TYPE_LINEAR_ACCELERATION : Measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), excluding the force of gravity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM