This project is read-only.

Architectural changes?

Nov 12, 2010 at 2:33 PM

First, hats off to the dev team on this project. This code took me from zero to working with live GPS data in no time flat.

As I continue working on my project (UAV/autopilot), I have made changes to the code, some of which are pretty major, to suit my needs. I think most of these change would be useful to other users but they would break interfaces and compatiblity with previous versions. And some changes were made just base on style so I have a weaker arguement there. :)

One fundemental change I made is giving more direct access and control to the individual NMEA sentences returned from the GPS. I need position, heading, speed, altitude, number of satellites and other data. No single NMEA sentence has all of that data, and I need some of it more often than others. Also, some of that data is avilalbe from more that one NMEA sentence, but I need to make sure it's correlated properly (e.g. I need altitude and position from the same fix, not altitude from one and lat/lon from another.)

To accomodate this, I created a class for each NMEA sentence. I keep a single instance of that class and that class is passed its raw data for parsing. Then I can put the data I need from the right place.

I also added altitude to the position fix class and added some calculations to make it easy to measure distance, bearing.

I'm using a high-rate GPS so I made some optimizations to the parsing logic too. That can be hidden behind the existing interfaces though so that's less of a challenge.

The abscrtions on different GPS types seem to be more trouble than they're worth. I think most of the differences can be accomodated by a more configurable NMEAGps class that can be inherited if needed, but can be used directly for most GPSs.

On style stuff--I noticed that a lot of the code was written with c-style return values to indicate success or error. When I modified code that did this, I removed it and changed it to throw exceptions as needed. This is a coding style thing that I feel strongly about in my code but I won't push my religion on you. :)

So any thoughts on this?  Should I just fork this into a different project or is there interest in incorporating this back into the mainstream release? I can check my code into a fork here if anyone wants to see it. It's not clean enough for reuse but it gives you an idea of what I'm doing.