albertaloop / T_SWE_2022_2023

Software for AlbertaLoop's first-generation pod.
MIT License
3 stars 0 forks source link

Improve GPS error in Navigation system #7

Open Iyury1 opened 2 years ago

Iyury1 commented 2 years ago

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:

  1. How long does it take for the (lat,lon) readings to stabilize? How many readings?
  2. What is the variance for the (lan,lon) readings once the coordinates have stabilized?
  3. Why does the distance not decrease when the (lat,lon) coordinate decreases back closer to the origin?

Acceptance Criteria for 1. and 2.

Acceptance Criteria for 3.

Iyury1 commented 1 year ago

Results files uploaded to https://github.com/albertaloop/T_SWE_2022_2023/blob/Navigation/GPS-test-sdcard/Firmware/GPS_Module_Teensy3.6/testresults3.txt

and

https://github.com/albertaloop/T_SWE_2022_2023/blob/Navigation/GPS-test-sdcard/Firmware/GPS_Module_Teensy3.6/testresults4.txt