04-18-2012 02:43 PM
I have a requirement to calculate the distance travelled by the user. I have gone through the forum and I found there are 2 ways of doing it.
1) Using GPS to get the latitiude & longitude and using the Haversine formula to get the distance
2) Using the accelerometer to find the number of steps and calculate the distance.
Please comment on which one will be more accurate . This application will be used daily basis and it will be used to track the running on a circular track. Is there any example available on how to use the accelerometer to use as a pedometer.
04-19-2012 02:53 AM
04-19-2012 04:00 AM
For the second one. I could imagine that you could count steps, but what about step distance. Tall people have bigger steps than short one. And if you run they should be bigger then you just walking. I'm not sure that you have this measurment from accelerometer.
04-19-2012 04:48 AM - edited 04-19-2012 04:51 AM
Can I just comment that I think you will have problems using GPS to track someone round a small circular track. Two reasons:
a) There is a fair amount of what I call jitter with GPS locations, in other words, even standing still, the phone can get GPS locations that suggest it is moving
b) There can be a fair degree of error in the readings anyway, so I think you will struggle to determine exactly when the user gets back to the starting point.
By small here I am talking about a standard athletics track. If you are doing a 10 K circular route GPS will be fine.
Like Simon, I have never looked at using the accelerometer to measure steps.
Note that the class Coordinates includes a distance claculation. So if you have two Coordinates, you can easily find the distance between them.
04-19-2012 04:59 AM
04-19-2012 05:42 AM - edited 04-19-2012 05:44 AM
I agree with Simon's points having also worked on a tracking solution. You can watch for things like dramatic changes in height that suggest the location is dodgy.
But I still suspect that in a small area, like an athletics track, you will have problems accurately measuring the distance.
As an example of this, I remember a presentation at one of the DevCons where the presenters had been to a ball game and tried to use GPS to find their location. They basically took 10 locations, removed outliers, and then averaged. It was fairly close to their seats but not exactly on it. And they were sitting still. In your case, 10 readings each say 2 seconds apart will give you a scatter gun of locations and I think you will struggle to determine which is the accurate path through these values and hence the accurate distance.
This is not a problem with BlackBerry specifically. You might find this interesting reading.
I was interested to see that one of the Posters in this Thread dismisses accelerometers as a viable way to do this.
One further minor point. If you start doing this, you will need to run the GPS hot (i.e. get locations every 10 seconds or less), which does have an impact on the battery life too. Tracking all day will kill the battery, 20 minutes or should be fine.