The first measurement taken is chosen to be our origin. This is done using a boolean "setOrigin" which is initialized to true and set to false after the first measurement. For each subsequent measurement, a distance calculation is made using the function tf.euclidean() between the most recent (x,y) point and the origin.
When we run the current Teensy code for the GPS module on "Navigation/main" the GPS (lat,lon) coordinates will slowly change over time while the sensor is stationary. The (lat,lon) coordinates seem to stabilize after a certain time, but there is still some drift in the exact value.
When the (lat,lon) coordinates drift in one direction, the calculated (x,y) distance from the origin slowly increases. When the (lat,lon) coordinates drift back closer to the stabilized value, the calculated (x,y) distance does not decrease but continues to increase.
Some test results showing this behavior has been uploaded to . One problem with this test data is that it was obtained by printing data to the Serial monitor and copying the values to a text file, but the Serial monitor can only display so much data at once and cannot be paused. What we can do is modify our Teensy program to log the values to an SD card.
When we have obtained sufficient test results we want to find out the following:
How long does it take for the (lat,lon) readings to stabilize? How many readings?
What is the variance for the (lan,lon) readings once the coordinates have stabilized?
Why does the distance not decrease when the (lat,lon) coordinate decreases back closer to the origin?
Acceptance Criteria for 1. and 2.
[x] Obtain sufficient test data from SD card
[x] Parse test results into a Python program to analyze the values.
[x] Use Python to quantify the time taken for (lat,lon) readings to stabilize, and the variance of stabilized readings.
[x] Plot results in Python.
Acceptance Criteria for 3.
[ ] Write a summary of the NMEA format into the Navigation Design Plan document, so that we know what the (lat,lon) values we get from the GPS sensor actually mean.
[ ] Generate test points in (lat,lon) for a stationary position with some added drift. Run the points through our distance function tf.euclidean() and examine the behavior.
[ ] Generate test points in (lat,lon) that gradually move to a distance of ~50ft and back to the origin. Run the points through our distance function and examine the behavior.
Summary
This code takes a readout of latitude and longitude from the GPS sensor and converts the (lat,lon) coordinates to (x,y) coordinates using an "equirectangular" projection with the function tf.equirectangular(). https://github.com/albertaloop/T_SWE_2022_2023/blob/Navigation/main/Firmware/GPS_Module_Teensy3.6/src/main.cpp
The first measurement taken is chosen to be our origin. This is done using a boolean "setOrigin" which is initialized to true and set to false after the first measurement. For each subsequent measurement, a distance calculation is made using the function tf.euclidean() between the most recent (x,y) point and the origin.
When we run the current Teensy code for the GPS module on "Navigation/main" the GPS (lat,lon) coordinates will slowly change over time while the sensor is stationary. The (lat,lon) coordinates seem to stabilize after a certain time, but there is still some drift in the exact value.
When the (lat,lon) coordinates drift in one direction, the calculated (x,y) distance from the origin slowly increases. When the (lat,lon) coordinates drift back closer to the stabilized value, the calculated (x,y) distance does not decrease but continues to increase.
Some test results showing this behavior has been uploaded to. One problem with this test data is that it was obtained by printing data to the Serial monitor and copying the values to a text file, but the Serial monitor can only display so much data at once and cannot be paused. What we can do is modify our Teensy program to log the values to an SD card.
When we have obtained sufficient test results we want to find out the following:
Acceptance Criteria for 1. and 2.
Acceptance Criteria for 3.