Adafruit GPS Shield & Uno - Rapid/Consistent Data retrieval needed for UAV

Power_Broker:
It seems to me that the main problem is more of processing efficiency and not necessarily memory (although that may be a separate issue).

The biggest inefficiency I see is here:

while (!gps.available(gpsPort)){

}




This is a blocking delay and is **BAD JUJU**. This will block your code for at least a whole second waiting for the next fix. The best thing to do is the following:



if (gps.available(gpsPort)){
  //do gps logging here
}




This way you only tie up processing power for the GPS when you get actual GPS data - the rest of the time the Arduino can process anything such as sensor polling from the IMU, printing debugging messages, datalogging, whatever else there is to be done.

I hope this helps.

Also, you will want to jack up the baud of both serial ports to around 115200. Depending on the GPS model, you can change the baud settings through certain configuration packets. There is also a chance you can change the refresh rate of the GPS with configuration packets. I know for certain you can make both of these changes for a NEO-6M GPS, but I don't know about the Adafruit one.

I'm planning on putting most of the code within the while loop, but I guess that's effectively the same? I'll give it a go.

I didn't know anything about the baud rates so that's really helpful cheers.