瀏覽代碼

upd ublox

MX 2 年之前
父節點
當前提交
5fefacb102
共有 2 個文件被更改,包括 14 次插入8 次删除
  1. 3 0
      non_catalog_apps/ublox/README.md
  2. 11 8
      non_catalog_apps/ublox/ublox_worker.c

+ 3 - 0
non_catalog_apps/ublox/README.md

@@ -95,6 +95,9 @@ display will also stop logging. If the GPS disconnects or becomes
 unreachable, logging will stop and all data will be saved. The log
 file is flushed every 16 writes in case a disk problem arises.
 
+Data points are only added to the KML file if the GPS has a fix,
+including a dead reckoning fix.
+
 ## Time synchronization
 ![u-blox app time synchronization display](screenshots/sync_time.png)
 

+ 11 - 8
non_catalog_apps/ublox/ublox_worker.c

@@ -203,14 +203,17 @@ void ublox_worker_read_nav_messages(void* context) {
 	    FURI_LOG_I(TAG, "sent callback");
 	    // if logging, add point
             if(ublox->log_state == UbloxLogStateLogging) {
-                if(!kml_add_path_point(
-                       &(ublox->kmlfile),
-                       // ublox returns values as floats * 1e7 in int form
-                       (double)(ublox->nav_pvt.lat) / (double)1e7,
-                       (double)(ublox->nav_pvt.lon) / (double)1e7,
-                       ublox->nav_pvt.hMSL / 1e3)) { // convert altitude to meters
-                    FURI_LOG_E(TAG, "failed to write line to file");
-                }
+		// only add points if there's a fix (even if it's only dead reckoning)
+		if (ublox->nav_pvt.fixType != 0) {
+		    if(!kml_add_path_point(
+					   &(ublox->kmlfile),
+					   // ublox returns values as floats * 1e7 in int form
+					   (double)(ublox->nav_pvt.lat) / (double)1e7,
+					   (double)(ublox->nav_pvt.lon) / (double)1e7,
+					   ublox->nav_pvt.hMSL / 1e3)) { // convert altitude to meters
+			FURI_LOG_E(TAG, "failed to write line to file");
+		    }
+		}
             }
         } else {
 	    // bad data