Detect device forward backward movement

£可爱£侵袭症+ 提交于 2019-12-12 04:48:14

问题


By any way can I find whether my device is moving forward or backward. Consider if I have kept my device on a moving object say a rc toy car facing front to take movie where all it goes. Can I detect whether the car is going forward or backward.

Is it possible possible with map sdk for movement about 10meter? How long it should move to get the result with map sdk ?


回答1:


With the accelerometer sensor, you know the position of the phone in relation with the car, you absolutely can detect the direction during accelaration. If your device is "looking forward", then you just need to monitor the changes of the x and z axis to create a direction vector.

If you use GPS data, you can also know the direction at any moment..



来源:https://stackoverflow.com/questions/44659888/detect-device-forward-backward-movement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!