Skip to content

Commit 3aabafd

Browse files
committed
Erase only when prioritized one has later(or timely equal) meas
1 parent f8d4663 commit 3aabafd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

perception/multi_object_tracker/src/multi_object_tracker_core.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ void MultiObjectTracker::sanitizeTracker(
437437
}
438438

439439
if (delete_candidate_tracker) {
440-
/* erase only when prioritized one has a measurement or the other one doesn't */
441-
if (sorted_list_tracker[i]->getNoMeasurementCount() <= 0 or
442-
sorted_list_tracker[j]->getNoMeasurementCount() > 0) {
440+
/* erase only when prioritized one has later(or equal time) meas than the other's */
441+
if (sorted_list_tracker[i]->getElapsedTimeFromLastUpdate(time) <=
442+
sorted_list_tracker[j]->getElapsedTimeFromLastUpdate(time)) {
443443
// Remove from original list_tracker
444444
list_tracker.remove(sorted_list_tracker[j]);
445445
// Remove from sorted list

0 commit comments

Comments
 (0)