Drawing in air with Android phone

爷,独闯天下 提交于 2019-12-05 03:21:43
Ali

Not exactly what you are looking for:

Store orientation to an array - and compare

Tracking orientation works well. Perhaps you can do something similar with the accelerometer data (without any integration).

As you mentioned in your post, integrating the acceleration twice does not work.

Update:

If accuracy is not important at all then the double integral might work for a few seconds but expect very poor results.

However, the gyro mouse is a better choice in my opinion. See between 37:00-38:25 in

Sensor Fusion on Android Devices: A Revolution in Motion Processing.

Take a look at:

http://www.youtube.com/watch?v=C7JQ7Rpwn2k

http://www.freescale.com/files/sensors/doc/app_note/AN3397.pdf

Also I'm working on a similar project and I don't think you need to double integrate accelertaion and calculate distance moved. Instead use acceleration itself for moving.

But if you insist to use distance, by sampling acceleration(a0,a1,...,an) in short time intervals(t0,t1,...,tn) and suppose your acceleration in this intervals is average of boundaries, you can have something like that;

 Vs=(t1-t0)*(a1+a0)/2 + (t2-t1)*(a2+a1)/2 + ... + (t[n]-t[n-1])(a[n]+a[n-1])/2

 T=t[n]-t[0]

 Xs=Vs*T

It is a little bit different from double intergating. Good luck.

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