简体   繁体   English

如何使用GPS数据或加速度计在android中找到减速度?

[英]How to find deceleration in android using either GPS data or accelerometer?

I am working on android app where I need to find hard breaks with threshold -3 meter/sec2. 我正在使用android应用程序,在其中我需要找到阈值-3米/秒2的难点。 Can it be done using speed variation or accelerometer? 可以使用速度变化或加速度计来完成吗?

Speed variation would work if you would move for a long time at the same speed, so that the phone can recognize that you do so. 如果您以相同的速度长时间移动,速度变化将起作用,以便电话可以识别出您已经这样做。 And then the phone should be able to know when you start slowing down, and when you stop. 然后电话应该能够知道何时开始减速以及何时停止。 And I don't think that it is accurate enough with GPS to do so. 而且我认为GPS不够准确。

The accelerometer would work, but it depends on how accurate that one is. 加速度计可以工作,但是要取决于加速度计的精度。 I know that the iPhone would be enough accurate, but I doubt that a lot of Android phones can do this too. 我知道iPhone足够准确,但是我怀疑很多Android手机也可以做到这一点。

I think you should use gps data, find the speed and then calculate acceleration. 我认为您应该使用gps数据,找到速度,然后计算加速度。 But I am not sure how to process the data because if you calculate only with two consecutive entries it will not be enough to find the accurate acceleration. 但是我不确定如何处理数据,因为如果仅使用两个连续的条目进行计算,将不足以找到准确的加速度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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