analysis script fixes
This commit is contained in:
@@ -163,6 +163,11 @@
|
||||
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||
</Types>
|
||||
<Types id="33" type="coderapp.internal.codertype.PrimitiveType">
|
||||
<ClassName>int32</ClassName>
|
||||
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||
</Types>
|
||||
</Types>
|
||||
</coderapp.internal.interface.project.Interface>
|
||||
</MF0>
|
||||
@@ -1178,7 +1183,7 @@
|
||||
</Artifacts>
|
||||
<BuildFolder type="coderapp.internal.util.mfz.FileSpec"/>
|
||||
<Success>true</Success>
|
||||
<Timestamp>2026-04-05T14:48:49</Timestamp>
|
||||
<Timestamp>2026-04-06T20:46:55</Timestamp>
|
||||
</MainBuildResult>
|
||||
</coderapp.internal.mlc.mfz.MatlabCoderProjectState>
|
||||
</MF0>
|
||||
|
||||
+17
-1
@@ -42,9 +42,10 @@ end
|
||||
% TRANSIT_ALT_STEP must exceed 2 * max(collisionRadius).
|
||||
% Waypoint 1: each UAV flies to (finalX, finalY) at its unique transit altitude.
|
||||
% Waypoint 2: each UAV adjusts to its actual target altitude.
|
||||
if ~coder.target('MATLAB')
|
||||
% These constants are also used for the altitude-staggered return before RTL.
|
||||
TRANSIT_ALT_BASE = 25.0; % must match drone.takeoff() altitude in uav_runner.py
|
||||
TRANSIT_ALT_STEP = 25; % vertical separation per UAV (m); must exceed 2*collisionRadius
|
||||
if ~coder.target('MATLAB')
|
||||
for ii = double(totalLoaded):-1:1
|
||||
transitRow = (ii - 1) * 2 + 1;
|
||||
finalRow = (ii - 1) * 2 + 2;
|
||||
@@ -190,6 +191,21 @@ if ~coder.target('MATLAB')
|
||||
end
|
||||
% --------------------------------------------------------------------------
|
||||
|
||||
% Altitude-staggered return: separate UAVs vertically before issuing RTL,
|
||||
% mirroring the initial positioning stagger so UAVs transit laterally at
|
||||
% unique altitudes and cannot collide during the return flight.
|
||||
if ~coder.target('MATLAB')
|
||||
for i = 1:numClients
|
||||
transitAlt = TRANSIT_ALT_BASE + (double(i) - 1) * TRANSIT_ALT_STEP;
|
||||
target = [positions(i, 1), positions(i, 2), transitAlt];
|
||||
coder.ceval('sendTarget', int32(i), coder.ref(target));
|
||||
end
|
||||
coder.ceval('waitForAllMessageType', int32(numClients), int32(MESSAGE_TYPE.ACK));
|
||||
coder.ceval('waitForAllMessageType', int32(numClients), int32(MESSAGE_TYPE.READY));
|
||||
else
|
||||
disp('Altitude-staggered return (simulation): UAVs commanded to transit altitudes.');
|
||||
end
|
||||
|
||||
% Send RTL command to all clients
|
||||
for i = 1:numClients
|
||||
if coder.target('MATLAB')
|
||||
|
||||
@@ -79,7 +79,7 @@ function [f, G] = plotGpsLogs(logDirs, seaToGroundLevel, plotWholeFlight)
|
||||
|
||||
fprintf("Minimum distance between agents %d and %d is %2.3f\n", ii, jj, min(d));
|
||||
if min(d) < 6
|
||||
warning("Minimum distance between agents %d and %d of %2.3f is questionable for AERPAW", ii, jj, min(d);
|
||||
warning("Minimum distance between agents %d and %d of %2.3f is questionable for AERPAW", ii, jj, min(d));
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%% Plot AERPAW logs (trajectory, radio)
|
||||
resultsPath = fullfile(matlab.project.rootProject().RootFolder, "sandbox", "two_around_wall"); % Define path to results copied from AERPAW platform
|
||||
resultsPath = fullfile(matlab.project.rootProject().RootFolder, "sandbox", "test2"); % Define path to results copied from AERPAW platform
|
||||
|
||||
% Measure intervals between issuing commands from the controller
|
||||
% (make sure this is ~4-5 seconds at minimum to avoid overwhelming the UAV autopilot)
|
||||
@@ -16,8 +16,8 @@ fprintf("Minimum command spacing: %2.3f seconds\n", seconds(min(dt)));
|
||||
fprintf("Maximum command spacing: %2.3f seconds\n", seconds(max(dt)));
|
||||
fprintf("Mean command spacing: %2.3f seconds\n", seconds(mean(dt)));
|
||||
fprintf("Median command spacing: %2.3f seconds\n", seconds(median(dt)));
|
||||
if seconds(min(dt)) > 4
|
||||
warning("Minimum command spacing %2.3f questionably short for AERPAW", min(dt));
|
||||
if seconds(min(dt)) < 4
|
||||
warning("Minimum command spacing %2.3f questionably short for AERPAW", seconds(min(dt)));
|
||||
end
|
||||
|
||||
% Plot GPS logged data and scenario information (domain, objective, obstacles)
|
||||
|
||||
Reference in New Issue
Block a user