I have problem in detect position for the iPhone mobile using accelerometer sensor I tried to integrate the accelerometer value twice to get position, but I had big error in the position after integration. I set the sample rate 100 . I sent accelerometer data to computer over wireless network to C# sever
dt=0.01// dt is the interval between two samples
volx+=linearAcceration[0]*dt;// volx is volcity over x axis
posx+=volx*dt;//posx is position over x axis
Where I used linear acceleration and calculated it using this equations:
float factoralpha=0.9f;
Gravity[0] = Gravity[0] * factoralpha + (1 - factoralpha) * xacc;//xacc is acceleration over x axis
Gravity[1] = Gravity[1] * factoralpha + (1 - factoralpha) * yacc;//yacc is acceleration over y axis
Gravity[2] = Gravity[2] * factoralpha + (1 - factoralpha) * zacc;//zacc is acceleration over z axis
linearAcceration[0] = xacc - Gravity[0];
linearAcceration[1] = yacc - Gravity[1];
linearAcceration[2] = zacc - Gravity[2];
I need the position for control the tennis racket in my computer game
Could anyone help me to simulate hand movements using accelelometer+gyroscope or get accurate position using accelerometer and gyroscope
I don't want to discourage you, but getting accurate position using an accelerometer and gyroscope is not a simple matter. While the math says that integrating acceleration twice will yield position, the truth is, the noise in the system quickly dominates the true position signal (noise in the accel itself, all the little taps and jolts it takes, plus quantization noise due to slow ~100Hz sampling). Dead reckoning systems today can run only for several 10s of seconds or maybe 1-2 minutes before requiring a recalibration of position. This can be done via triangulation via Bluetooth or WiFi beacons, or by placing the racket near a thing in a known place, like a previously positioning NFC tag. Also, it's likely that 100Hz is not enough, you'll need perhaps 1-2KHz heavily (max rate of accels these days is ~2KHz) filtered down to a bandwidth of ~20Hz, depending upon the speed of movement of your tennis racket. I doubt a standard cellphone can achieve this since I think they sample ~100Hz maximum. Companies (I'm not sure who) are working on such systems, but they are more difficult to achieve good results than you might expect.
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.