What causes a continuity error while using metrics?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I am using this example: https://www.mathworks.com/help/fusion/ug/simulate-and-track-en-route-air-traffic-with-earth-centered-scenarios.html
and I want to calculate RMS error for radar, adsb. So here is the code that I wrote:
My while loop looks like:
while advance(scene)
time = scene.SimulationTime;
.
% Same as Example
.
% Record the estimated airplane data for metrics
fusedTrackLog = [fusedTrackLog, {fusedTracks}]; %#ok<AGROW>
radarTrackLog = [radarTrackLog, {radarTracks}]; %#ok<AGROW>
adsbTrackLog = [adsbTrackLog, {adsbTracks}]; %#ok<AGROW>
% Here I am keeping a log of truth data. (Taken from - Lidar and Radar Fusion in Urban Air Mobility Scenario example)
logCount = logCount + 1;
truthlog{logCount} = logTargetTruth(scene.Platforms(2:end), truePose);
% Move camera and take snapshots
images = moveCamera(viewer,airplane,time,snapTimes,images);
end
My logTargetTruth function gathers true pose, true velocity , Acceleration, and Orientation as shown below:
function logEntry = logTargetTruth(targets, truePose)
n = numel(targets);
targetPoses = repmat(struct('Position',[],'Velocity',[],'Acceleration',[],'Orientation',[]),1,n);
for i=1:n
targetPoses(i).Position = truePose.Position(1:3);
targetPoses(i).Velocity = truePose.Velocity(1:3);
targetPoses(i).Acceleration = truePose.Acceleration(1:3);
targetPoses(i).Orientation = truePose.Orientation(1:end);
targetPoses(i).PlatformID = i;
end
logEntry = targetPoses;
end
Now I encounter an error saying :
Error using fusion.internal.metrics.TrackHistory/generateContinuityError
The following track identifiers were deleted in a previous call and may not be re-examined: 2
Error in fusion.internal.metrics.History/validateNewEntries (line 77)
generateContinuityError(obj, newIDs(isResurrected));
Error in fusion.internal.metrics.History/init (line 58)
validateNewEntries(obj, sortedID(iNew), getIdentifier(obj.Deleted));
Error in fusion.internal.metrics.AssignmentMetrics/initTracks (line 163)
[sortIdx, iDeletedTrack, iExistingTrack, iNewTrack] = init(obj.TrackHistory,tracks);
Error in fusion.internal.metrics.AssignmentMetrics/analyze (line 106)
[iDeletedTrack, iExistingTrack, iNewTrack] = initTracks(obj, tracks);
Error in trackAssignmentMetrics/stepImpl (line 625)
obj.pTAM.analyze(tracks, truths);
Error in rmseTRYmark2 (line 197)
[trackAM,truthAM] = tam(tracks, truths);
So here is the code where I am trying to calculate RMS error on position and velocity. However I get the above error on trackAssignmentMetric. What does it mean? and How do I prevent the track identifiers to be deleted.
tam = trackAssignmentMetrics;
tem = trackErrorMetrics;
posRMSE = zeros(numel(radarTrackLog),1);
velRMSE = zeros(numel(radarTrackLog),1);
posANEES = zeros(numel(radarTrackLog),1);
velANEES = zeros(numel(radarTrackLog),1);
for i=1:numel(radarTrackLog)
tracks = radarTrackLog{i};
truths = truthlog{i};
[trackAM,truthAM] = tam(tracks, truths);
[trackIDs,truthIDs] = currentAssignment(tam);
[posRMSE(i),velRMSE(i),posANEES(i),velANEES(i)] = ...
tem(tracks,trackIDs,truths,truthIDs);
end
0 Kommentare
Antworten (1)
Elad Kivelevitch
am 21 Feb. 2023
The trackAssignmentMetrics and trackErrorMetrics require you to report all the truths and tracks at every time you update them.
What you see here is that Track #2 was unreported in a previous step, which lead to it being deleted. Then, you reported it back, which leads to the error.
To avoid the error, you would need to report the track at all steps until it is deleted.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!