Skip to content

Principle Introduction and Theoretical Support Analysis: Target Tracking and Target Selection

billythedummy edited this page Aug 24, 2019 · 7 revisions

Introduction

This page presents the algorithm we use for persistent target tracking. Our system is able to identify and ID plates across time. To do so, a list of currently tracked targets is kept. This list has its elements updated, removed or new targets added to it on every frame depending on the frame's detections.

Having distinguished the available targets from one another, it then designates a primary target that it tries to aim and fire at consistently.

Relevant Files

  • aruw_vision/src/tracked_target.py
  • aruw_vision/src/target_tracker.py
  • aruw_vision/src/aim_turret.py

Flowchart

The entire decision process for the tracking algorithm is shown in the flowchart below. The currently tracked targets is represented by tracked_targets

flowchart

Relevant code references

aim_turret.py

  1. Calls the darknet detector to build frame_targets, line 101
  2. Passes frame_targets to target_tracker to do the tracking update presented above, line 102

target_tracker.py

  1. Predicts the states of all its existing target ahead to the new frame's timestamp, lines 129-131
  2. Sorts the remaining existing targets and picks the closest to the newly detected target, lines 157-159
  3. Checks if the distance is within the threshold limit and initialize new target if it is not, lines 161-166
  4. Updates tracking for the successfully matched existing target and removes it from existing_predictions, lines 168-171
  5. Checks if the primary target currently exists, line 179
  6. Removes unmatched tracked targets that have exceeded the time threshold from _tracked_targets and updates the tracking states of those that have not yet exceeded the time threshold with their predicted states, lines 180-187
  7. If primary target does not current exist or was removed, choose new primary target, lines 189-190

Primary target selection

The constructor of TargetTracker takes a target_rank_fn function reference argument that is used as the key for selecting the primary target.

Our target_rank_fn is currently a weighted sum of distance away from the turret and the skew angle of the target. TargetTracker therefore designates the easiest target to hit as the primary target since close and unskewed targets will be ranked first.

Refer to line 40 of aim_turret.py for the function definition.

Areas for improvement/ Roadmap

  • Clustering algorithm so that we can determine which plates belong to the same robot
  • Experiment with using a tracker to improve target correlation instead of relying on detections + distance to predictions alone
  • Tune our current target_rank_fn
  • Experiment with different target_rank_fns to match different needs