What causes a continuity error while using metrics?

1 Ansicht (letzte 30 Tage)
Harsh Rangwala
Harsh Rangwala am 21 Feb. 2023
Kommentiert: Harsh Rangwala am 22 Feb. 2023
Hello,
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

Antworten (1)

Elad Kivelevitch
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.
  1 Kommentar
Harsh Rangwala
Harsh Rangwala am 22 Feb. 2023
Thank you. Could you please let me know how can I work on this? Do I report the track while the simulation is running?

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by