Commit 7a53913 1 parent e2bd68f commit 7a53913 Copy full SHA for 7a53913
File tree 3 files changed +12
-13
lines changed
perception/multi_object_tracker/src/tracker/model
3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,8 @@ BicycleTracker::BicycleTracker(
143
143
ekf_.init (X, P);
144
144
145
145
// Set lf, lr
146
- lf_ = bounding_box_.length * 0.3 ; // 30% front from the center
147
- lr_ = bounding_box_.length * 0.3 ; // 30% rear from the center
146
+ lf_ = std::max ( bounding_box_.length * 0.3 , 0.3 ) ; // 30% front from the center, minimum of 0.3m
147
+ lr_ = std::max ( bounding_box_.length * 0.3 , 0.3 ) ; // 30% rear from the center, minimum of 0.3m
148
148
}
149
149
150
150
bool BicycleTracker::predict (const rclcpp::Time & time)
@@ -425,8 +425,8 @@ bool BicycleTracker::measureWithShape(
425
425
bbox_object.shape .dimensions .x , bbox_object.shape .dimensions .y , bbox_object.shape .dimensions .z };
426
426
427
427
// update lf, lr
428
- lf_ = bounding_box_.length * 0.3 ; // 30% front from the center
429
- lr_ = bounding_box_.length * 0.3 ; // 30% rear from the center
428
+ lf_ = std::max ( bounding_box_.length * 0.3 , 0.3 ) ; // 30% front from the center, minimum of 0.3m
429
+ lr_ = std::max ( bounding_box_.length * 0.3 , 0.3 ) ; // 30% rear from the center, minimum of 0.3m
430
430
431
431
return true ;
432
432
}
Original file line number Diff line number Diff line change @@ -158,8 +158,8 @@ BigVehicleTracker::BigVehicleTracker(
158
158
setNearestCornerOrSurfaceIndex (self_transform); // this index is used in next measure step
159
159
160
160
// Set lf, lr
161
- lf_ = bounding_box_.length * 0.3 ; // 30% front from the center
162
- lr_ = bounding_box_.length * 0.25 ; // 25% rear from the center
161
+ lf_ = std::max ( bounding_box_.length * 0.3 , 1.5 ) ; // 30% front from the center, minimum of 1.5m
162
+ lr_ = std::max ( bounding_box_.length * 0.25 , 1.5 ) ; // 25% rear from the center, minimum of 1.5m
163
163
}
164
164
165
165
bool BigVehicleTracker::predict (const rclcpp::Time & time)
@@ -457,9 +457,8 @@ bool BigVehicleTracker::measureWithShape(
457
457
bbox_object.shape .dimensions .x , bbox_object.shape .dimensions .y , bbox_object.shape .dimensions .z };
458
458
459
459
// update lf, lr
460
- lf_ = bounding_box_.length * 0.3 ; // 30% front from the center
461
- lr_ = bounding_box_.length * 0.25 ; // 25% rear from the center
462
-
460
+ lf_ = std::max (bounding_box_.length * 0.3 , 1.5 ); // 30% front from the center, minimum of 1.5m
461
+ lr_ = std::max (bounding_box_.length * 0.25 , 1.5 ); // 25% rear from the center, minimum of 1.5m
463
462
return true ;
464
463
}
465
464
Original file line number Diff line number Diff line change @@ -158,8 +158,8 @@ NormalVehicleTracker::NormalVehicleTracker(
158
158
setNearestCornerOrSurfaceIndex (self_transform); // this index is used in next measure step
159
159
160
160
// Set lf, lr
161
- lf_ = bounding_box_.length * 0.3 ; // 30% front from the center
162
- lr_ = bounding_box_.length * 0.25 ; // 25% rear from the center
161
+ lf_ = std::max ( bounding_box_.length * 0.3 , 1.0 ) ; // 30% front from the center, minimum of 1.0m
162
+ lr_ = std::max ( bounding_box_.length * 0.25 , 1.0 ) ; // 25% rear from the center, minimum of 1.0m
163
163
}
164
164
165
165
bool NormalVehicleTracker::predict (const rclcpp::Time & time)
@@ -457,8 +457,8 @@ bool NormalVehicleTracker::measureWithShape(
457
457
bbox_object.shape .dimensions .x , bbox_object.shape .dimensions .y , bbox_object.shape .dimensions .z };
458
458
459
459
// update lf, lr
460
- lf_ = bounding_box_.length * 0.3 ; // 30% front from the center
461
- lr_ = bounding_box_.length * 0.25 ; // 25% rear from the center
460
+ lf_ = std::max ( bounding_box_.length * 0.3 , 1.0 ) ; // 30% front from the center, minimum of 1.0m
461
+ lr_ = std::max ( bounding_box_.length * 0.25 , 1.0 ) ; // 25% rear from the center, minimum of 1.0m
462
462
463
463
return true ;
464
464
}
You can’t perform that action at this time.
0 commit comments