gps log plotting
This commit is contained in:
@@ -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:
|
||||
|
||||
22
aerpaw/results/plotGpsCsvs.m
Normal file
22
aerpaw/results/plotGpsCsvs.m
Normal 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");
|
||||
Reference in New Issue
Block a user