Skip to content

Commit

Permalink
Merge pull request #1063 from dstl/TrackToTruth_mindist
Browse files Browse the repository at this point in the history
Handle distance of 0 correctly in TrackToTruth associator
  • Loading branch information
sdhiscocks authored Jul 24, 2024
2 parents 7644596 + 3d4ad38 commit fdc5c5e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions stonesoup/dataassociator/tracktotrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def associate_tracks(self, tracks_set: Set[Track], truth_set: Set[GroundTruthPat

for track_state in Track.last_timestamp_generator(track):

min_dist = None
min_dist = self.association_threshold
min_truth = None

for truth in truth_set:
Expand All @@ -290,11 +290,7 @@ def associate_tracks(self, tracks_set: Set[Track], truth_set: Set[GroundTruthPat
continue

distance = self.measure(track_state, truth_state)
if min_dist and distance < min_dist:
min_dist = distance
min_truth = truth
elif not min_dist \
and distance < self.association_threshold:
if distance < min_dist:
min_dist = distance
min_truth = truth

Expand Down

0 comments on commit fdc5c5e

Please sign in to comment.