HomeSoftware


Software interface to get location
adelash
Hi,
I am looking for laptop gps software that would allow the application I will create to retrieve the current location every few milliseconds. I know that garmin navigation systems shows speed which is very accurate.

This question might pertain to the hardware section but I will ask just in case: How accurate are the locations? Is it software dependent? Are we talking 1-2 feet? or more like 30 feet?

Thanks in advance
Ken in Regina
More like 15 to 30 feet for consumer-grade GPS receivers. You would need a survey quality product to get consistently as good as 1 or 2 feet.

Sampling every few milliseconds is a waste of time with consumer receivers. The majority only send fresh location information once per second (1Hz). Some can be set to send updates as often as 5Hz and I think I've even seen one or two that can do up to 10Hz.

Do you need the data in real time? If not, there are a number of applications that can capture the GPS data and save it to a log file that you can process after the fact.

The GPS receivers send data as streams of text in "sentences". The sentences are defined by the NMEA standard. If you want near realtime you can just write your application to read the specific NMEA sentences you want. The simplest would be to use serial port communication. Most devices come with a driver that creates a virtual COM port you can attach to. If not, you can use a program like Xport or GPSGate to create the virtual COM port for you.

...ken...
adelash
First of all, thank you for the reply Ken. It was very informative. Perhaps, I can explain the purpose behind my question. Since you guys are experts there might be a better way of doing it.

I am a computer engineer and currently working on an amatuer project (so I do not have insane funding, my budget is limited and time is not an issue). Part of my project is to collect data points every 5 meters. The data point should be the gps coordinates. I will be driving my car and will have a laptop and a power source. Of course this would be incredibly easy if I drove at a constant speed (that way, I can poll the coordinates every Y seconds where Y= 5 meters / fixed car's speed in meters per second).

How would I, using the apropriate software and hardware, get a reading of coordinates every X meters? The coordinates will be saved in a log file and assume the driving direction is not predictable.

How expensive are accurate gps (~1-2 feet). I currently have a garmin 255W.
adelash
I just spent a couple of hours roaming around this website. I saw your post on GPS accuracy in the hardware section. It seems like I will not be able to get an accurate reading unless I spend thousands of dollars on a GPS surveying gadget. Is there any way to know when I traveled X meters? I will have to interface it with my laptop (which should not be a problem). I thought of adding a sensor to the tire and calculating the rotation then deriving the distance traveled. However that is outside the scope of this forum. Any ideas? My traveling speed would be anywhere between 0-100 km/hr
t1d
Do you need to know the coordinates every five meters, or do you just need to take a sample every 5 meters?
adelash
Quote:
Do you need to know the coordinates every five meters, or do you just need to take a sample every 5 meters?
Hi t1dunn,
I figured out that some software (listed in the sticky note) can save routes with times/coordinates. So essentially, now I just want to sample every 5 meters regardless of location.
MrUmbra
I think you're asking for too much from a single frequency GPS. I'm not aware of any nonmilitary receivers that can provide sub-meter accuracy real time.

Military receivers use two frequencies to remove timing delay effects of the earth atmosphere. Air Force data indicates military accuracy of about 1.5 meters for 95% of the fixes is routinely achieved. These signals are currently encrypted.

That kind of performance might eventually be available to us civil users when enough modernized satellites that will transmit on multiple open frequencies become available many-many years from now.

Survey receivers also use the two frequencies but in a different manner. I'm not aware of any that work while moving.

--- CHAS
adelash
I think I will use Garmin Mobile PC to save my route and figure out a way to get an accurate reading of the distance traveled. This could be a sensor on the tire or using the OBD-II interface provided on almost all cars. This is out of the scope of the forum I think.

Thanks for all the help/advice so far!
t1d
I have seen TV shows with a single wheeled measuring device pulled behind the car. I think a higher end touring bicycle could be adapted for the purpose. It is likely that it might not last forever at highway speeds, but that type of bike is not likely to fall apart on the first run. Give a local cycle club a call to see if they can help you find a good, used one.

I think the adaptation is as easy as removing the front wheel and attaching the front fork to the car's trailer hitch receiver. For measuring, you might consider a bicycle computer. They are pretty cheap and measure mileage and speed, amoung other things. Some higher end models may have a computer interface. It reads a magnet attached to the wheel as it spins past the sensor. If the bike computer doesn't have a computer interface that can be adapted, a feed could be taken directly from the sensor.

I think a bike club would be a good resource, in general. A few computer feeds with some basic math and your in business.

And, before someone says it, I am not advocating that someone ride the bike during testing.
adelash
Thanks a lot t1dunn! I will explore your suggestion, I am just worried it might die when going 100km/hr.
Ken in Regina
Hi adelash,

It would be helpful if you could provide a little more about what you are trying to accomplish. If you have Mobile PC and a receiver, switch to the trip computer and see if that tells you anything useful.

What's magic about the 5 metre distance?

Do you need audible notification? Visual notification? Just capture the fact that it happened?

Will a log file do the trick so you can review it after the fact? Or do you need to know something at the instant you pass each 5 metre point (at 100kph that's almost continuous!)?

There are applications that will log location data at user-specified intervals, usually time-based.

Terminology tip: I don't think you want to record "routes". Routes are something you plan and calculate in advance and then follow in order to get to a destination. I think you want to record a "track". That's something that gets recorded as you travel and you can save and review after the fact.

Mobile PC maintains a track log and you can view tracks on the map. If you go TOOLS > Manage My Data > Tracks you can save the active track, clear the active track so you can start fresh, view any saved tracks and set track options. In the track options you can set the recording interval and a couple of other options.

...ken...
adelash
Hi Ken,
You are right, I meant record a track and not a route. Well essentially I want an event notification every X meters (direction and speed is not constant).

So every say 5 meters my laptop receives a notification and does something (for simplicity assume saves elevation to a log file and that I have an easy way to get elevation) then wait for the next 5 meters and so on...


This is why I initially wanted a super accurate gps system since I could easily compare point A and point B until difference is 5 meters.
Ken in Regina
Regarding the "accuracy" issue, please read this:

http://www.laptopgpsworld.com/777-what-gps-accuracy-anyway

The point is that there are a variety of answers to the question of GPS accuracy. We've been talking about the accuracy of a consumer GPS receiver at fixing the location of a specific point on the planet. Not really great unless you let it sit a long time and average the readings.

But you don't want absolute accuracy, it doesn't sound like. It sounds like you want accurate measurement of distance between two points. That's a horse of a very different colour.

Do you really need realtime notification to you? If you are travelling at speeds of up to 100kph, what on earth are you going to do about it anyway? As I mentioned in a previous post, at 100kph or anything close to it, any sort of audible or visual notification will be on continuously if it's happening every 5 metres.

Or do you just need the necessary information captured in a file to analyze after the fact.

I've attached an image of a sample track log that was captured on my Garmin handheld from a bicycle ride in my neighborhood. As you can see, it has the lat/lon for each point in the list as well as the time that point was passed, the elevation at that point, the distance travelled since the last point and the speed of that leg.

In the program that is displaying this list I can display the track overlaid on any of a number road and topographic maps. I can also display the elevation profile. I've also attached an image of a sample elevation profile of a short trail ride in the Rockies.

Is that anything close to what you're after?

...ken...
Attached Images
adelash
Hi Ken,
Thank you for an amazing detailed reply! That might be close to what I am looking for, does Garmin Mobile PC provide the same level of accuracy FOR DISTANCES? It seems your handheld device is getting the length down to meters. This might be really helpful.

So what am I really going to do with this? I did not want to answer this question to avoid confusing people, but I am working on an amateur project to recreate a Google street view car on a LOW BUDGET. So every 5 meters I will snap a picture (I have the necessary software, logic, and circuitry to do this efficiently I just need a notification for every 5 meters).
Ken in Regina
Okay, for that application you are concerned with two aspects of accuracy.

If you use the GPS readings to trigger the camera you need a reasonable degree of accuracy of the distance measurement.

If you are going to geocode the images so they can be matched to specific locations on a map, you also need a reasonable degree of accuracy for the absolute position, at least relative to the accuracy of the calibration of the map(s) you plan to use them with.

Here are some options that spring immediately to mind. (Caveat: this is just thinking out loud with no actual analysis of practicality in your particular case.)

----------------------

Option 1.

Use a video camera so it's running continuously. Make sure that it's a camera that timestamps either the frames or at least the first frame.

Use a GPS to record the track as you drive it.

At the start of a shooting session, sync the time in the camera with the time in the GPS.

Use post-processing to match individual frames with the relevant times in the GPS track log, pull them out as single images and geocode them.

----------------------

Option 2.

Don't do the shooting based on position; do it based on speed. Write a simple application for the laptop to notify your trigger software based on your speed. At any speed it's trivial to compute how much time it takes to travel 5 metres.

Connect the GPS and camera to the laptop. Use the GPS to provide the realtime speed to the camera control program and to capture a track log.

Use post-processing to match images based on their timestamps with the relevant locations in the track log and geocode them.

----------------------

Option 3.

Don't do the shooting based on position; do it based on speed. Write a simple application for the laptop to notify your trigger software based on your speed. At any speed it's trivial to compute how much time it takes to travel 5 metres.

Use a camera that can have an external GPS connected to it so the images will be geocoded on the fly.

Use an ODBII cable and software for the laptop to get your speed from the car's computer to feed the camera control program.

----------------------

The "camera control" program I mention in options 2 and 3 would simply sample the speed, calculate how much time it takes to travel 5 metres and send notification to the stuff you already have. In the case of GPS input to it, you just need to know the applicable sentence for speed:

Quote:
VTG - Velocity made good.

GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48




where:
  • VTG Track made good and ground speed
  • 054.7,T True track made good (degrees)
  • 034.4,M Magnetic track made good
  • 005.5,N Ground speed, knots
  • 010.2,K Ground speed, Kilometers per hour
  • *48 Checksum
I have no clue how you would do the equivalent with ODBII but it shouldn't be any more difficult.

Those are just off the top of my head. I'm sure there are more possibilities that someone more creative than I can think up.

The limiting factor underlying all of these or any others is how accurate do the actual locations have to be? What maps are you planning to use the images with and how accurately are they calibrated with respect to reality? (Tip: Google's maps are not terribly accurate nor all that consistent from place to place.)

...ken...
adelash
Thanks Ken. The first option is the easiest but will require a lot of space since the video will run continuously. The second and third options are better. Third option is ideal at this point because the OBDII interface will give the most accurate speed.

Thanks again for all the great help.
Ken in Regina
I would not bet on ODBII giving the best speed. All it knows is the engine revs and the reduction ratio of the gear you are in combined with the rear end gearing. It's guessing at the circumference of your tires. That can make a big difference. If the "speedo" software doesn't allow you to input the actual warmed-up circumference of your tires you could have substantial inaccuracy.

GPS is doing a constant comparison of the distance travelled in the past second against the amount of time passed. This gives a very accurate speed measurement.

Here in Canada we have sections of highways that are measured at every kilometre for five kilometres so people can check their odometer and speedometer accuracy. They're set up by the CAA which is the Canadian branch of the AAA. I have been using them for years to do comparisons between the odometer and speedometer in my vehicles versus the GPS.

I first started doing this long before I got my first GPS, first to verify speedo and odometer accuracy in my vehicles when new. Then to check if, and how much, they changed whenever I got new tires. Then I checked my first GPS against them. Since then I have found my GPS receivers all to be spot on for speed and distance versus the markers where my vehicles have all had some amount of inaccuracy.

I wonder if anyone on here has ever done a comparison between the GPS speed and distance (via the "trip meter" in most nav software) and the same info from ODBII in their vehicle. That would be a really interesting comparison.

...ken...
adelash
Very interesting, Ken. Do you work for a GPS company? You seem to be an expert in GPS!
Ken in Regina
No, I don't work for a GPS company and I'm sure a long ways from being an expert. But thank you.

I am a technology guy. I've been an IT professional for over thirty years. I worked in the telecommunications industry until I retired a few years ago, for a Canadian telco and for Nortel. I worked in the IT department and also in Engineering. So I'm pretty comfortable with technology.

...ken...
adelash
Ken,
That makes sense. I am a recent graduate working in silicon valley as a computer engineer. I wanted to use my time by creating something more interesting that involves building/programming/designing circuits/contraptions, it was either that or playing video games. I decided to be wise for once!
Ken in Regina
It sounds like you've picked a really fun project. Please keep us posted from time to time how it's going. I'm really curious to know what works for you. Mostly I've just been tossing out ideas that might help get you thinking in a useful direction. And, of course, don't hesitate to ask more questions.

...ken...
adelash
Thanks Ken that was very helpful I will keep this forum posted.
I just came back from a 30minute test run with my Garmin 20x GPS and nRoute application. I recorded a route and it was pretty accurate, though I have some questions:

1) Not that it is important but elevation is showing around -180ft, based on my city map the lowest elevation is 13ft below sea level. What is going on?

2) I can see the track clearly and there is a window that displays each segment (I set it to add a point every 3ft), however from looking at the map only I cannot see the direction or the order of the segments. Could this be added to the view? If not, are there any other applications that are more tailored towards tracks? Of course they have to accept mapsource maps.




Edit: I do not usually drive like that, it was just for the purpose of testing the track feature :P and I was not drunk
Ken in Regina
You should see some of my GPS test tracks. Yours is pretty lame tame.

There is no way that I know of in Mapsource (or nRoute) to show the direction of travel on a track. I've never looked for any other program for messing with tracks because Mapsource does everything I need.

Elevation is not something you can trust very much with a consumer grade GPS. I won't get into a description because it's way beyond the scope of this forum but it has to do with the angles from the satellites to your location. Getting a GPS location is basically a matter of triangulation. The more satellites you have and the more spread out the constellation of the ones you are receiving from, the more accurate the location fix will be.

But for elevation there is never a very good angle. The satellites are so high that the angles for triangulation on elevation are too steep to be very reliable. Once they get low enough on the horizon to be more useful they are typically out of sight.

Also, counterintuitive as it might seem, the problem is worse at lower elevations because the satellites that could give the most accurate triangulation for elevation (e.g. nearest the horizon) are long out of sight whereas you can actually get some pretty good elevation readings up in the mountains. I've had readings in high mountain passes that were within a few feet of the sign at the summit.

If you're interested in something more than baby talk, check out GPS stuff on Wikipedia. There is lots of good information there. Also, Google is your friend.

...ken...
adelash
UPDATE:
I was able to hook up my laptop to the car's OBD-II interface. Wrote a serial comm. application to request the vehicle speed every few milliseconds. Speed is highly accurate! Should give me an idea about the distance and when to take the pictures.

Next step:
1- Write logic for when to take a picture
2- Research the camera gear I believe some cameras allow GPS coordinates to be embedded in every picture
Ken in Regina
Thanks for the update.

As I mentioned early in the discussion, you have a couple of choices for cameras: ones with builtin GPS receivers and ones that allow connection of an external GPS receiver. The ones with builtin receivers might work okay if the camera will be mounted on the outside of the vehicle with a good view of the sky and you won't be driving in concrete canyons. The reviews I've seen on them so far don't give me a lot of good feelings about the accuracy of the GPS receivers in them.

If you get one that allows connection an external GPS receiver, you can control the quality of receiver you attach and where you position it for the best satellite reception.

In either case you have to deal with the issue of weather resistance. You can do that by buying a weather-resistant camera, which will severely limit your choices if you want to have the camera do the geocoding. Or you can make sure that any camera you buy has a weather resistant enclosure available for it from some third party. Any weather resistant enclosure will need to accomodate your shutter control connection.

And, of course, any camera you buy will need to accomodate some sort of external shutter control.

Or you can forget about having the camera geocode the images and just connect the GPS receiver to your computer, capture a track log of location points as you drive and use geocoding software for post-processing the coordinates into the EXIF data in the images.

There are applications for post-processing that allow you to geocode your images after the fact. It's just more information in the EXIF info of a digital image. Whether the camera puts it there or you add it in post-processing doesn't matter a lot. You just need to be sure the clock in the camera is synchronized to the GPS clock at the start of a shooting run. Most of the geocoding software will cope with a modest delta between the timestamps on the images and the timestamps on the locations in the track log. Some of the geocoding software allows you to specify the maximum allowable delta and also how to cope with the delta (e.g. use the one nearest in time before the timestamp or after the timestamp, or the one nearest in time regardless which direction.)

...ken...
© Laptop GPS WorldContact