@@ -300,25 +300,32 @@ void MultiObjectTracker::runProcess(
300
300
char buf[200 ];
301
301
auto tracker_itr = std::next (list_tracker.begin (), meas_tracker_idx->second );
302
302
(*tracker_itr)->getTrackedObject (measurement_time, track_object);
303
- snprintf (buf, sizeof (buf), " detect->track link idx[%ld]->[%d], x[%.3f]->x[%.3f], y[%.3f]->y[%.3f], cls[%d]->cls[%d]" ,
304
- measurement_idx, meas_tracker_idx->second ,
305
- measurement_object.kinematics .pose_with_covariance .pose .position .x , track_object.kinematics .pose_with_covariance .pose .position .x ,
306
- measurement_object.kinematics .pose_with_covariance .pose .position .y , track_object.kinematics .pose_with_covariance .pose .position .y ,
307
- measurement_object.classification .at (0 ).label , track_object.classification .at (0 ).label );
308
- debug_message += buf;
309
- RCLCPP_INFO (this ->get_logger (), " object links:%s" , debug_message.c_str ());
310
- debug_message = " " ;
303
+ if ( abs (measurement_object.kinematics .twist_with_covariance .twist .linear .x ) > 0.3 or
304
+ abs (measurement_object.kinematics .twist_with_covariance .twist .linear .y ) > 0.3 ) {
305
+
306
+ snprintf (buf, sizeof (buf), " detect->track link idx[%ld]->[%d], vx[%.3f]->vx[%.3f], vy[%.3f ]->vy[%.3f], cls[%d]->cls[%d]" ,
307
+ measurement_idx, meas_tracker_idx->second ,
308
+ measurement_object.kinematics .twist_with_covariance .twist .linear .x , track_object.kinematics .twist_with_covariance .twist .linear .x ,
309
+ measurement_object.kinematics .twist_with_covariance .twist .linear .y , track_object.kinematics .twist_with_covariance .twist .linear .y ,
310
+ measurement_object.classification .at (0 ).label , track_object.classification .at (0 ).label );
311
+ debug_message += buf;
312
+ RCLCPP_INFO (this ->get_logger (), " object links:%s" , debug_message.c_str ());
313
+ debug_message = " " ;
314
+ }
311
315
}
312
316
else {
313
- char buf[120 ];
314
- snprintf (buf, sizeof (buf), " detect->track link idx[%ld]->[nan], x[%.3f]->x[nan], y[%.3f]->y[nan], cls[%d]->cls[nan]" ,
315
- measurement_idx,
316
- measurement_object.kinematics .pose_with_covariance .pose .position .x ,
317
- measurement_object.kinematics .pose_with_covariance .pose .position .y ,
318
- measurement_object.classification .at (0 ).label );
319
- debug_message += buf;
320
- RCLCPP_INFO (this ->get_logger (), " object links:%s" , debug_message.c_str ());
321
- debug_message = " " ;
317
+ if ( abs (measurement_object.kinematics .twist_with_covariance .twist .linear .x ) > 0.3 or
318
+ abs (measurement_object.kinematics .twist_with_covariance .twist .linear .y ) > 0.3 ) {
319
+ char buf[200 ];
320
+ snprintf (buf, sizeof (buf), " detect->track link idx[%ld]->[nan], vx[%.3f]->vx[nan], vy[%.3f ]->vy[nan], cls[%d]->cls[nan]" ,
321
+ measurement_idx,
322
+ measurement_object.kinematics .twist_with_covariance .twist .linear .x ,
323
+ measurement_object.kinematics .twist_with_covariance .twist .linear .y ,
324
+ measurement_object.classification .at (0 ).label );
325
+ debug_message += buf;
326
+ RCLCPP_INFO (this ->get_logger (), " object links:%s" , debug_message.c_str ());
327
+ debug_message = " " ;
328
+ }
322
329
}
323
330
}
324
331
0 commit comments