gps log plotting
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -64,3 +64,5 @@ aerpaw/client/__pycache__/*
|
|||||||
aerpaw/codegen/
|
aerpaw/codegen/
|
||||||
aerpaw/codegen/*
|
aerpaw/codegen/*
|
||||||
|
|
||||||
|
# results
|
||||||
|
*.csv
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import asyncio
|
|||||||
import csv
|
import csv
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import struct
|
import struct
|
||||||
import time
|
import time
|
||||||
import yaml
|
import yaml
|
||||||
@@ -111,7 +112,8 @@ def _gps_log_row(vehicle, line_num, writer):
|
|||||||
|
|
||||||
async def _gps_log_loop(drone):
|
async def _gps_log_loop(drone):
|
||||||
"""Background async task that logs GPS data at 1Hz."""
|
"""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}")
|
print(f"[UAV] GPS logging to {filename}")
|
||||||
line_num = 1
|
line_num = 1
|
||||||
try:
|
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");
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info location="plotGpsCsvs.m" type="File"/>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Info location="playback.m" type="File"/>
|
|
||||||
Reference in New Issue
Block a user