first aerpaw test prepared

This commit is contained in:
2026-04-02 13:19:14 -07:00
parent f598a832fa
commit 31e88a8535
4 changed files with 31 additions and 10 deletions
+6 -3
View File
@@ -1,7 +1,8 @@
function [f, G] = plotGpsLogs(logDirs, seaToGroundLevel)
function [f, G] = plotGpsLogs(logDirs, seaToGroundLevel, plotWholeFlight)
arguments (Input)
logDirs (1, 1) string;
seaToGroundLevel (1, 1) double = 110; % measured approximately from USGS national map viewer for the AERPAW test field
plotWholeFlight (1, 1) logical = false;
end
arguments (Output)
f (1, 1) matlab.ui.Figure;
@@ -48,8 +49,10 @@ function [f, G] = plotGpsLogs(logDirs, seaToGroundLevel)
stopIdx = find(verticalSpeed <= prctile(verticalSpeed, pctThreshold), 1, "last");
% % Plot whole flight, including setup/cleanup
% startIdx = 1;
% stopIdx = length(verticalSpeed);
if plotWholeFlight
startIdx = 1;
stopIdx = length(verticalSpeed);
end
% Convert LLA trajectory data to ENU for external analysis
% NaN out entries outside the algorithm flight range so they don't plot
+16 -4
View File
@@ -31,14 +31,26 @@ function R = readRadioLogs(logPath)
end
fid = fopen(filepath, 'r');
% Skip 3 lines: 2 junk (tail errors) + 1 header (tx_uav_id,value)
for k = 1:3
fgetl(fid);
% Skip header lines: some files have 2 tail-error lines + 1 column
% header ("tx_uav_id,value"), others start with data immediately.
% Read until a line that looks like a data record, then rewind to it.
dataPattern = '^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+\] [-\d]';
linePos = ftell(fid);
while true
line = fgetl(fid);
if ~ischar(line)
break; % EOF
end
if ~isempty(regexp(line, dataPattern, 'once'))
fseek(fid, linePos, 'bof'); % rewind to start of this line
break;
end
linePos = ftell(fid);
end
data = textscan(fid, '[%26c] %d,%f');
fclose(fid);
ts = datetime(data{1}, 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
ts = datetime(cellstr(data{1}), 'InputFormat', 'yyyy-MM-dd HH:mm:ss.SSSSSS');
txId = int32(data{2});
val = data{3};
+3 -2
View File
@@ -3,7 +3,8 @@ resultsPath = fullfile(matlab.project.rootProject().RootFolder, "sandbox", "two_
% Plot GPS logged data and scenario information (domain, objective, obstacles)
seaToGroundLevel = 110; % measured approximately from USGS national map viewer
[fGlobe, G] = plotGpsLogs(resultsPath, seaToGroundLevel);
plotWholeFlight = true; % do not attempt to automatically trim initial and final positioning and landing from flight plot (buggy)
[fGlobe, G] = plotGpsLogs(resultsPath, seaToGroundLevel, true);
% Plot radio statistics
[fRadio, R] = plotRadioLogs(resultsPath);
@@ -21,7 +22,7 @@ makeVideo = true;
% Define scenario according to CSV specification
domain = rectangularPrism;
domain = domain.initialize([params.domainMin; params.domainMax], REGION_TYPE.DOMAIN, "Domain");
domain.objective = domain.objective.initialize(objectiveFunctionWrapper(params.objectivePos, reshape(params.objectiveVar, [2 2])), domain, params.discretizationStep, params.protectedRange, params.sensorPerformanceMinimum);
domain.objective = domain.objective.initialize(objectiveFunctionWrapper(params.objectivePos, reshape(params.objectiveVar, [1, 2 2])), domain, params.discretizationStep, params.protectedRange, params.sensorPerformanceMinimum);
agents = cell(size(params.initialPositions, 2) / 3, 1);
for ii = 1:size(agents, 1)