Skip to content

Commit

Permalink
Fix HoC Compare people tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
KenH2 committed Nov 20, 2023
1 parent 80c9cf3 commit 109bf2a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions people_tracking/src/people_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def callback_hoc(self, data: ColourCheckedTarget, amount_detections_stored: int
nr_batch, time, nr_persons, x_positions, y_positions, z_positions, _, face_detected = self.detections[idx]
self.detections[idx] = Persons(nr_batch, time, nr_persons, x_positions, y_positions, z_positions, colour_vectors, face_detected)

self.compare_hoc(idx) # Temp for Hoc
self.compare_hoc(idx) # Temp for Hoc

def callback_face(self, data: ColourCheckedTarget, amount_detections_stored: int = 100) -> None:
""" Add the latest Face detection to the storage."""
Expand Down Expand Up @@ -249,7 +249,7 @@ def do_data_association(self, detection: Persons) -> None:
self.data_data_association.append([nr_batch, person])
if self.ukf_data_association.current_time < time:
self.ukf_data_association.update(time, [x_positions[person], y_positions[person], 0])
rospy.loginfo(self.data_data_association)
# rospy.loginfo(self.data_data_association)

# def redo_data_association(self, start_batch: int, idx_person: int):
# """ Redo the data association from a start batch nr.
Expand Down Expand Up @@ -413,11 +413,13 @@ def plot_tracker(self): #TODO redo with new data

def compare_hoc(self, idx_detection):
""" Compare newly detected persons to previously detected target."""
if idx_detection is None:
return
bridge = CvBridge()
match = False
idx_person = None

person_vectors = [detection.colour_vector for detection in self.detections[idx_detection]]
person_vectors = self.detections[idx_detection].colour_vectors

if len(self.HoC_detections) < 1:
self.HoC_detections.append(person_vectors[0])
Expand Down Expand Up @@ -467,4 +469,4 @@ def loop(self):
node_pt.loop()
rospy.spin()
except rospy.exceptions.ROSInterruptException:
pass
pass

0 comments on commit 109bf2a

Please sign in to comment.