gps log plotting

This commit is contained in:
2026-02-16 11:19:10 -08:00
parent fd6ebf538c
commit fb9feac23d
7 changed files with 29 additions and 3 deletions

2
.gitignore vendored
View File

@@ -64,3 +64,5 @@ aerpaw/client/__pycache__/*
aerpaw/codegen/
aerpaw/codegen/*
# results
*.csv

View File

@@ -24,6 +24,7 @@ import asyncio
import csv
import datetime
import os
import platform
import struct
import time
import yaml
@@ -111,7 +112,8 @@ def _gps_log_row(vehicle, line_num, writer):
async def _gps_log_loop(drone):
"""Background async task that logs GPS data at 1Hz."""
filename = f"/root/Results/GPS_DATA_{datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')}.csv"
host = platform.node()
filename = f"/root/Results/GPS_DATA_{host}_{datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')}.csv"
print(f"[UAV] GPS logging to {filename}")
line_num = 1
try:

View File

@@ -0,0 +1,22 @@
% Plot setup
f = uifigure;
gf = geoglobe(f);
hold(gf, "on");
c = ["r", "g", "b", "m", "c", "y", "k"]; % plotting colors
seaToGroundLevel = 110; % meters, measured approximately from USGS national map viewer
% Paths to logs
gpsCsvs = ["GPS_DATA_0c8d904aa159_2026-02-16_13:26:33.csv"; ...
"GPS_DATA_8e4f52dac04d_2026-02-16_13:26:33.csv"; ...
];
G = cell(size(gpsCsvs));
for ii = 1:size(gpsCsvs, 1)
% Read CSV
G{ii} = readGpsCsv(gpsCsvs(ii));
% Plot recorded trajectory
geoplot3(gf, G{ii}.Latitude, G{ii}.Longitude, G{ii}.Altitude + seaToGroundLevel, c(mod(ii, length(c))), 'LineWidth', 3, "MarkerSize", 5);
end
hold(gf, "off");

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="plotGpsCsvs.m" type="File"/>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="playback.m" type="File"/>