@@ -195,7 +195,7 @@ def to_tf(self):
195
195
#for name, kfs in mass:
196
196
197
197
if self .sort_by_score :
198
- kfs = sorted (kfs , key = lambda x : x .score )
198
+ kfs = sorted (kfs , key = lambda x : x .score , reverse = True )
199
199
200
200
for i , kf in enumerate (kfs ):
201
201
@@ -227,7 +227,7 @@ def to_tracked_object_array(self):
227
227
for name , kfs in self .objects_to_KFs .items ():
228
228
229
229
if self .sort_by_score :
230
- kfs = sorted (kfs , key = lambda x : x .score )
230
+ kfs = sorted (kfs , key = lambda x : x .score , reverse = True )
231
231
232
232
for i , kf in enumerate (kfs ):
233
233
@@ -272,7 +272,7 @@ def to_marker_array(self):
272
272
i = - 1
273
273
274
274
if self .sort_by_score :
275
- kfs = sorted (kfs , key = lambda x : x .score )
275
+ kfs = sorted (kfs , key = lambda x : x .score , reverse = True )
276
276
277
277
for i , kf in enumerate (kfs ):
278
278
# TEXT
@@ -420,7 +420,7 @@ def cobject_cb(self, msg):
420
420
self .mutex .release ()
421
421
return
422
422
423
- self .proceed_objects (msg .header , msg .complex_objects , transform , now )
423
+ self .proceed_objects (msg .header , [ cmp . complex_object for cmp in msg .objects ] , transform , now )
424
424
self .mutex .release ()
425
425
426
426
@@ -433,13 +433,15 @@ def proceed_objects(self, header, objects, transform, now):
433
433
434
434
if obj .transform .translation .z == 1 :
435
435
continue
436
-
437
- if obj .score < self .min_score :
438
- if obj .score < self .min_score_soft :
439
- continue if self .sort_by_score :
440
- kfs = sorted (kfs , key = lambda x : x .score )
441
- soft_tracking = True
442
-
436
+
437
+ if obj .score < self .min_score :
438
+ if obj .score < self .min_score_soft :
439
+ continue
440
+ soft_tracking = True
441
+
442
+ #if self.sort_by_score:
443
+ #kfs = sorted(kfs, key=lambda x: x.score)
444
+
443
445
ps = obj_transform_to_pose (obj .transform , header )
444
446
445
447
ps_transformed = tf2_geometry_msgs .do_transform_pose (ps , transform ).pose
@@ -459,7 +461,7 @@ def proceed_objects(self, header, objects, transform, now):
459
461
continue # skip soft_tracking
460
462
self .objects_to_KFs [obj_name ].append (SingleKFUndirectedObjectTracker (pose [:2 ], now , self .Qdiag , self .Rdiag , self .k_decay , self .colors [self .current_color ], pose [3 ]))
461
463
self .current_color += 1
462
- if self .current_color > len (self .colors ):
464
+ if self .current_color >= len (self .colors ):
463
465
self .current_color = 0
464
466
else :
465
467
@@ -492,9 +494,11 @@ def proceed_objects(self, header, objects, transform, now):
492
494
for i in extra_poses :
493
495
if poses [i ][2 ] == 1 : # soft_tracking
494
496
continue
495
- self .objects_to_KFs [obj_name ].append (SingleKFUndirectedObjectTracker (poses [i ], now , self .Qdiag , self .Rdiag , self .k_decay , self .colors [self .current_color ], poses [i ][3 ]))
497
+
498
+ self .objects_to_KFs [obj_name ].append (SingleKFUndirectedObjectTracker (poses [i ][:2 ], now , self .Qdiag , self .Rdiag , self .k_decay , self .colors [self .current_color ], poses [i ][3 ]))
499
+
496
500
self .current_color += 1
497
- if self .current_color > len (self .colors ):
501
+ if self .current_color >= len (self .colors ):
498
502
self .current_color = 0
499
503
500
504
0 commit comments