Android Community
Results 1 to 8 of 8

Thread: can the android g1 gps calculate speed?

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Default can the android g1 gps calculate speed?


    I know many gps units with the capability of telling you your exact miles per hour. Is the g1 gps capable of doing the same? I was thinking about a vehicle performance data app that could tell the driver 0-60 times and various other information.


    Thanks

  2. #2
    Join Date
    Oct 2008
    Location
    Hokes Bluff, AL
    Posts
    744

    Default Re: can the android g1 gps calculate speed?

    Yes, it's possible.

    The MyTracks app does it.

    Speed is simply distance over time... ANY GPS knows your location (kinda the point, right?). As long as it can store 2 locations (start, end) and keep time spent between those 2 points, then it can calculate speed... The GPS isn't technically what matters - it's the software that's USING the gps unit that matters.

  3. #3
    Join Date
    Oct 2008
    Location
    Brooklynnn nyyy
    Posts
    1,304

    Default Re: can the android g1 gps calculate speed?

    I would think its not always accurate.... about a 1-2mph difference.

  4. #4
    Join Date
    Mar 2009
    Posts
    5

    Default Re: can the android g1 gps calculate speed?

    Sure it can! There are several apps available now that show speed, heading, time and distance etc.

  5. #5
    Join Date
    Dec 2008
    Location
    Virginia
    Posts
    1,365

    Default Re: can the android g1 gps calculate speed?

    It definitely can, as far as accuracy it'll be 1 mile off if at all. If you set up the GPS to report back every 5 seconds or similar, average it and do a simple distance over time with a mileage conversion -- you should be golden.

  6. #6
    Join Date
    Mar 2009
    Posts
    2

    Default Re: can the android g1 gps calculate speed?

    Ok thanks guys.

    Oh, and one more thing. For 0-60 calculation, do you suggest that I use the phone's accelerometer or stick with the gps supplied speed and simply put a timer on it to 60 mph.

  7. #7
    Join Date
    Dec 2008
    Location
    Virginia
    Posts
    1,365

    Default Re: can the android g1 gps calculate speed?

    Quote Originally Posted by xin0811 View Post
    Ok thanks guys.

    Oh, and one more thing. For 0-60 calculation, do you suggest that I use the phone's accelerometer or stick with the gps supplied speed and simply put a timer on it to 60 mph.
    GPS, since the accelerometer is influenced by too many outside factors (bumps, movements, etc). Use the GPS, in which you can have the reading in Android returned over X amount of seconds (the SDK supports this already). Then just do a simple distance over time calculation, and that should be it.

    Also average it over the time, because if there's a spike you don't want the user to be concerned.

  8. #8
    Join Date
    Oct 2008
    Posts
    502

    Default Re: can the android g1 gps calculate speed?


    Yes, you want to use the GPS, not the accelerometer.....accelerometers are notoriously noisy. You'd have to integrate the data over time to get speed. It would work, but it would be really twitchy, probably with some steady-state error due to the numerical integration.

    Much, much, much easier to use the position and time information from the GPS. The GPS data rate is pretty slow....around 1 to 2Hz....that's once or twice a second. But it makes for a nice, steady data stream for calculating speed without a need to filter off noisy or errant data.

    GPS data consists of only four things......latitude, longitude, altitude, and time. If you assume a flat earth, the calculation is easy enough that any 4th grader could do it. Simple distance = rate * time.....just calculate the distance traveled between the last two position points and divide by the time elapsed....bingo...you got your speed.

    It gets more complex if you want to use a round earth model and calculate great circle distances, but the math for that isn't especially difficult either. Plenty of algorithms to do that floating around on the net and in books.

    And yes, most GPS speedo's are highly accurate....much more so than any car. I've checked two handheld units against some really expensive high-accuracy/high-precision military grade telemetry systems (at NASA) and find they are usually damn close (as long as Nellis AFB isn't jamming them that day!!!!).

    If you are going to program an app to do this, pay attention to your floating point precision.....the number of digits after the decimal point are important....don't get lazy and cut them off to three or four. I'd go with twelve or even sixteen numerals after the decimal. GPS is really impressive.....it's amazing that something so complex that requires such a high degree of precision works so well.
    Last edited by f4phantomii; 04-08-2009 at 08:27 AM.

Similar Threads

  1. Speed dial?
    By Stewartwi in forum General HTC Chat
    Replies: 20
    Last Post: 06-24-2009, 01:18 PM
  2. Replies: 1
    Last Post: 11-21-2008, 12:53 AM
  3. Need for Speed
    By paranoidandroid in forum All About Andorid Software
    Replies: 2
    Last Post: 11-18-2008, 02:17 PM
  4. 3G speed after OTA update
    By schumann in forum General Phone Chat
    Replies: 10
    Last Post: 11-06-2008, 03:53 AM
  5. Android would beat any phone in speed test
    By refused9150 in forum General Phone Chat
    Replies: 0
    Last Post: 09-17-2008, 08:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •