moved origin to get more space from geofence

This commit is contained in:
2026-03-02 12:15:01 -08:00
parent 387d6aea56
commit e40d2e4614
16 changed files with 64 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ function obj = run(obj, domain, partitioning, timestepIndex, index, agents)
% Guard against near-zero gradient: when sensor performance is saturated
% or near-zero across the whole partition, rateFactor -> Inf and pNext
% explodes. Stay put instead.
if gradNorm < 1e-10
if gradNorm < 1e-100
pNext = obj.pos;
else
pNext = obj.pos + (targetRate / gradNorm) * gradC;

View File

@@ -2,8 +2,8 @@
# ENU coordinate system origin (AERPAW Lake Wheeler Road Field)
origin:
lat: 35.727436
lon: -78.696471
lat: 35.72550610629396
lon: -78.70019657805574
alt: 0.0 # Alt=0 means ENU z directly becomes target altitude above home
# Environment-specific settings
environments:

View File

@@ -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
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, "", ""
1 timestep maxIter minAlt discretizationStep protectedRange initialStepSize barrierGain barrierExponent collisionRadius comRange alphaDist betaDist alphaTilt betaTilt domainMin domainMax objectivePos sensorPerformanceMinimum initialPositions numObstacles obstacleMin obstacleMax
2 5 100 25.0 0.1 1.0 1.0 100 3 3.0 60.0 30.0 60.0 0.2 10.0 1.0 0.0, 0.0, 0.0 20.0, 20.0, 55.0 50.0, 50.0, 100.0 10.0, 10.0 35.0, 35.0 1e-6 5.0, 10.0, 45.0, 15.0, 10.0, 30.0 0

View File

@@ -93,6 +93,16 @@
<Size type="coderapp.internal.codertype.Dimension"/>
<Size type="coderapp.internal.codertype.Dimension"/>
</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>
</coderapp.internal.interface.project.Interface>
</MF0>
@@ -1060,7 +1070,7 @@
</Artifacts>
<BuildFolder type="coderapp.internal.util.mfz.FileSpec"/>
<Success>true</Success>
<Timestamp>2026-02-27T17:26:39</Timestamp>
<Timestamp>2026-03-02T11:41:10</Timestamp>
</MainBuildResult>
</coderapp.internal.mlc.mfz.MatlabCoderProjectState>
</MF0>

View File

@@ -4,11 +4,12 @@ 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
lla0 = [35.72550610629396, -78.70019657805574, seaToGroundLevel]; % origin (LLA)
% Paths to logs
gpsCsvs = fullfile ("sandbox", "test2", ...
["GPS_DATA_0c8d904aa159_2026-02-27_20:52:33.csv"; ...
"GPS_DATA_8e4f52dac04d_2026-02-27_20:52:33.csv"; ...
gpsCsvs = fullfile ("sandbox", "test4", ...
["GPS_DATA_0c8d904aa159_2026-03-02_14:42:51.csv"; ...
"GPS_DATA_8e4f52dac04d_2026-03-02_14:42:52.csv"; ...
]);
G = cell(size(gpsCsvs));
@@ -16,8 +17,31 @@ for ii = 1:size(gpsCsvs, 1)
% Read CSV
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
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
% 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");

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="aerpaw/config" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="aababef5-9f49-40b0-be1a-63743f2447a1" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="test4" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="test3" type="File"/>

View File

@@ -27,7 +27,7 @@ classdef parametricTestSuite < matlab.unittest.TestCase
methods (Test)
% Test cases
function test_scenario(tc)
function test_AERPAW_scenario(tc)
% Load scenario definition
tc.csvPath = fullfile(matlab.project.rootProject().RootFolder, "aerpaw", "config", "scenario.csv");
params = tc.testClass.readScenarioCsv(tc.csvPath);