moved origin to get more space from geofence
This commit is contained in:
@@ -79,7 +79,7 @@ function obj = run(obj, domain, partitioning, timestepIndex, index, agents)
|
|||||||
% Guard against near-zero gradient: when sensor performance is saturated
|
% Guard against near-zero gradient: when sensor performance is saturated
|
||||||
% or near-zero across the whole partition, rateFactor -> Inf and pNext
|
% or near-zero across the whole partition, rateFactor -> Inf and pNext
|
||||||
% explodes. Stay put instead.
|
% explodes. Stay put instead.
|
||||||
if gradNorm < 1e-10
|
if gradNorm < 1e-100
|
||||||
pNext = obj.pos;
|
pNext = obj.pos;
|
||||||
else
|
else
|
||||||
pNext = obj.pos + (targetRate / gradNorm) * gradC;
|
pNext = obj.pos + (targetRate / gradNorm) * gradC;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
# ENU coordinate system origin (AERPAW Lake Wheeler Road Field)
|
# ENU coordinate system origin (AERPAW Lake Wheeler Road Field)
|
||||||
origin:
|
origin:
|
||||||
lat: 35.727436
|
lat: 35.72550610629396
|
||||||
lon: -78.696471
|
lon: -78.70019657805574
|
||||||
alt: 0.0 # Alt=0 means ENU z directly becomes target altitude above home
|
alt: 0.0 # Alt=0 means ENU z directly becomes target altitude above home
|
||||||
# Environment-specific settings
|
# Environment-specific settings
|
||||||
environments:
|
environments:
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
timestep, maxIter, minAlt, discretizationStep, protectedRange, initialStepSize, barrierGain, barrierExponent, collisionRadius, comRange, alphaDist, betaDist, alphaTilt, betaTilt, domainMin, domainMax, objectivePos, sensorPerformanceMinimum, initialPositions, numObstacles, obstacleMin, obstacleMax
|
timestep, maxIter, minAlt, discretizationStep, protectedRange, initialStepSize, barrierGain, barrierExponent, collisionRadius, comRange, alphaDist, betaDist, alphaTilt, betaTilt, domainMin, domainMax, objectivePos, sensorPerformanceMinimum, initialPositions, numObstacles, obstacleMin, obstacleMax
|
||||||
5, 100, 25.0, 0.1, 1.0, 1.0, 100, 3, 3.0, 60.0, 60.0, 0.2, 10.0, 1.0, "0.0, 0.0, 0.0", "20.0, 20.0, 55.0", "10.0, 10.0", 1e-6, "5.0, 10.0, 45.0, 15.0, 10.0, 30.0", 0, "", ""
|
5, 100, 25.0, 0.1, 1.0, 1.0, 100, 3, 3.0, 30.0, 60.0, 0.2, 10.0, 1.0, "0.0, 0.0, 0.0", "50.0, 50.0, 100.0", "35.0, 35.0", 1e-6, "5.0, 10.0, 45.0, 15.0, 10.0, 30.0", 0, "", ""
|
||||||
|
@@ -93,6 +93,16 @@
|
|||||||
<Size type="coderapp.internal.codertype.Dimension"/>
|
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||||
<Size type="coderapp.internal.codertype.Dimension"/>
|
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||||
</Types>
|
</Types>
|
||||||
|
<Types id="19" type="coderapp.internal.codertype.PrimitiveType">
|
||||||
|
<ClassName>int32</ClassName>
|
||||||
|
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||||
|
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||||
|
</Types>
|
||||||
|
<Types id="20" type="coderapp.internal.codertype.PrimitiveType">
|
||||||
|
<ClassName>int32</ClassName>
|
||||||
|
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||||
|
<Size type="coderapp.internal.codertype.Dimension"/>
|
||||||
|
</Types>
|
||||||
</Types>
|
</Types>
|
||||||
</coderapp.internal.interface.project.Interface>
|
</coderapp.internal.interface.project.Interface>
|
||||||
</MF0>
|
</MF0>
|
||||||
@@ -1060,7 +1070,7 @@
|
|||||||
</Artifacts>
|
</Artifacts>
|
||||||
<BuildFolder type="coderapp.internal.util.mfz.FileSpec"/>
|
<BuildFolder type="coderapp.internal.util.mfz.FileSpec"/>
|
||||||
<Success>true</Success>
|
<Success>true</Success>
|
||||||
<Timestamp>2026-02-27T17:26:39</Timestamp>
|
<Timestamp>2026-03-02T11:41:10</Timestamp>
|
||||||
</MainBuildResult>
|
</MainBuildResult>
|
||||||
</coderapp.internal.mlc.mfz.MatlabCoderProjectState>
|
</coderapp.internal.mlc.mfz.MatlabCoderProjectState>
|
||||||
</MF0>
|
</MF0>
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ gf = geoglobe(f);
|
|||||||
hold(gf, "on");
|
hold(gf, "on");
|
||||||
c = ["r", "g", "b", "m", "c", "y", "k"]; % plotting colors
|
c = ["r", "g", "b", "m", "c", "y", "k"]; % plotting colors
|
||||||
seaToGroundLevel = 110; % meters, measured approximately from USGS national map viewer
|
seaToGroundLevel = 110; % meters, measured approximately from USGS national map viewer
|
||||||
|
lla0 = [35.72550610629396, -78.70019657805574, seaToGroundLevel]; % origin (LLA)
|
||||||
|
|
||||||
% Paths to logs
|
% Paths to logs
|
||||||
gpsCsvs = fullfile ("sandbox", "test2", ...
|
gpsCsvs = fullfile ("sandbox", "test4", ...
|
||||||
["GPS_DATA_0c8d904aa159_2026-02-27_20:52:33.csv"; ...
|
["GPS_DATA_0c8d904aa159_2026-03-02_14:42:51.csv"; ...
|
||||||
"GPS_DATA_8e4f52dac04d_2026-02-27_20:52:33.csv"; ...
|
"GPS_DATA_8e4f52dac04d_2026-03-02_14:42:52.csv"; ...
|
||||||
]);
|
]);
|
||||||
|
|
||||||
G = cell(size(gpsCsvs));
|
G = cell(size(gpsCsvs));
|
||||||
@@ -16,8 +17,31 @@ for ii = 1:size(gpsCsvs, 1)
|
|||||||
% Read CSV
|
% Read CSV
|
||||||
G{ii} = readGpsCsv(gpsCsvs(ii));
|
G{ii} = readGpsCsv(gpsCsvs(ii));
|
||||||
|
|
||||||
|
% Find when algorithm begins/ends (using ENU altitude)
|
||||||
|
enuTraj = lla2enu([G{ii}.Latitude, G{ii}.Longitude, G{ii}.Altitude], lla0, 'flat');
|
||||||
|
|
||||||
|
verticalSpeed = movmean(abs(diff(G{ii}.Altitude)), [10, 0]);
|
||||||
|
|
||||||
|
startIdx = find(verticalSpeed <= prctile(verticalSpeed, 25), 1, 'first');
|
||||||
|
stopIdx = find(verticalSpeed <= prctile(verticalSpeed, 10), 1, 'last');
|
||||||
|
% startIdx = 1;
|
||||||
|
% stopIdx = length(verticalSpeed);
|
||||||
|
|
||||||
|
speed = vecnorm(diff(enuTraj), 2, 2);
|
||||||
|
meanSpeed = movmean(speed, [10, 0]);
|
||||||
|
|
||||||
% Plot recorded trajectory
|
% Plot recorded trajectory
|
||||||
geoplot3(gf, G{ii}.Latitude, G{ii}.Longitude, G{ii}.Altitude + seaToGroundLevel, c(mod(ii, length(c))), 'LineWidth', 2, "MarkerSize", 5);
|
geoplot3(gf, G{ii}.Latitude(startIdx:stopIdx), G{ii}.Longitude(startIdx:stopIdx), G{ii}.Altitude(startIdx:stopIdx) + seaToGroundLevel, c(mod(ii, length(c))), 'LineWidth', 2, "MarkerSize", 5);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
% Plot objective
|
||||||
|
objectivePos = [35, 35, 0];
|
||||||
|
llaObj = enu2lla(objectivePos, lla0, 'flat');
|
||||||
|
geoplot3(gf, [llaObj(1), llaObj(1)], [llaObj(2), llaObj(2)], [llaObj(3), llaObj(3) + 50], 'LineWidth', 3);
|
||||||
|
|
||||||
|
% Plot domain
|
||||||
|
domain = [lla0; enu2lla([50, 50, 100], lla0, 'flat')];
|
||||||
|
geoplot3(gf, [domain(1, 1), domain(2, 1), domain(2, 1), domain(1, 1), domain(1, 1)], [domain(1, 2), domain(1, 2), domain(2, 2), domain(2, 2), domain(1, 2)], repmat(domain(1, 3) + 10, 1, 5), 'LineWidth', 3);
|
||||||
|
|
||||||
hold(gf, "off");
|
hold(gf, "off");
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info Ref="aerpaw/config" Type="Relative"/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info location="aababef5-9f49-40b0-be1a-63743f2447a1" type="Reference"/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info location="test4" type="File"/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info/>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Info location="test3" type="File"/>
|
||||||
@@ -27,7 +27,7 @@ classdef parametricTestSuite < matlab.unittest.TestCase
|
|||||||
|
|
||||||
methods (Test)
|
methods (Test)
|
||||||
% Test cases
|
% Test cases
|
||||||
function test_scenario(tc)
|
function test_AERPAW_scenario(tc)
|
||||||
% Load scenario definition
|
% Load scenario definition
|
||||||
tc.csvPath = fullfile(matlab.project.rootProject().RootFolder, "aerpaw", "config", "scenario.csv");
|
tc.csvPath = fullfile(matlab.project.rootProject().RootFolder, "aerpaw", "config", "scenario.csv");
|
||||||
params = tc.testClass.readScenarioCsv(tc.csvPath);
|
params = tc.testClass.readScenarioCsv(tc.csvPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user