performance - Calculation User speed and distance using device accelerometer android -
hi developing small android application in wanted calculate user speed , distance covered user using device accelerometer. did take samples of acceleration in time frame 1 min. accelerometer got x y , z coordinates. took x coordinate values , take average of it. , calculating speed of user.
but not giving proper value. there way this? how give me approx value? did in following way:
// sum of no samples of acceleration points sum_acc = sum_acc+event.values[0]; // avg of acc avg_acc = sum_acc/no_of_samples; // speed of user speed = avg_acc*time_frame; // distance distance = speed*time;
i need better , accurate result. need help. thank you.
Comments
Post a Comment