@@ -58,12 +58,12 @@ BicycleTracker::BicycleTracker(
58
58
59
59
// Initialize parameters
60
60
// measurement noise covariance: detector uncertainty + ego vehicle motion uncertainty
61
- double r_stddev_x = 0.5 ; // in vehicle coordinate [m]
62
- double r_stddev_y = 0.4 ; // in vehicle coordinate [m]
63
- double r_stddev_yaw = tier4_autoware_utils::deg2rad (30 ); // in map coordinate [rad]
64
- ekf_params_.r_cov_x = std::pow ( r_stddev_x, 2.0 ) ;
65
- ekf_params_.r_cov_y = std::pow ( r_stddev_y, 2.0 ) ;
66
- ekf_params_.r_cov_yaw = std::pow ( r_stddev_yaw, 2.0 ) ;
61
+ const float r_stddev_x = 0.5 ; // in vehicle coordinate [m]
62
+ const float r_stddev_y = 0.4 ; // in vehicle coordinate [m]
63
+ const float r_stddev_yaw = tier4_autoware_utils::deg2rad (30 ); // in map coordinate [rad]
64
+ ekf_params_.r_cov_x = r_stddev_x * r_stddev_x ;
65
+ ekf_params_.r_cov_y = r_stddev_y * r_stddev_y ;
66
+ ekf_params_.r_cov_yaw = r_stddev_yaw * r_stddev_yaw ;
67
67
68
68
// OBJECT SHAPE MODEL
69
69
if (object.shape .type == autoware_auto_perception_msgs::msg::Shape::BOUNDING_BOX) {
@@ -169,16 +169,14 @@ autoware_auto_perception_msgs::msg::DetectedObject BicycleTracker::getUpdatingOb
169
169
const autoware_auto_perception_msgs::msg::DetectedObject & object,
170
170
const geometry_msgs::msg::Transform & /* self_transform*/ ) const
171
171
{
172
- autoware_auto_perception_msgs::msg::DetectedObject updating_object;
172
+ autoware_auto_perception_msgs::msg::DetectedObject updating_object = object ;
173
173
174
174
// OBJECT SHAPE MODEL
175
175
// convert to bounding box if input is convex shape
176
176
if (object.shape .type != autoware_auto_perception_msgs::msg::Shape::BOUNDING_BOX) {
177
177
if (!utils::convertConvexHullToBoundingBox (object, updating_object)) {
178
178
updating_object = object;
179
179
}
180
- } else {
181
- updating_object = object;
182
180
}
183
181
184
182
// UNCERTAINTY MODEL
@@ -231,8 +229,7 @@ bool BicycleTracker::measureWithPose(
231
229
bool BicycleTracker::measureWithShape (
232
230
const autoware_auto_perception_msgs::msg::DetectedObject & object)
233
231
{
234
- autoware_auto_perception_msgs::msg::DetectedObject bbox_object;
235
- if (!object.shape .type == autoware_auto_perception_msgs::msg::Shape::BOUNDING_BOX) {
232
+ if (object.shape .type != autoware_auto_perception_msgs::msg::Shape::BOUNDING_BOX) {
236
233
// do not update shape if the input is not a bounding box
237
234
return false ;
238
235
}
@@ -241,21 +238,21 @@ bool BicycleTracker::measureWithShape(
241
238
constexpr double size_max = 30.0 ; // [m]
242
239
constexpr double size_min = 0.1 ; // [m]
243
240
if (
244
- bbox_object .shape .dimensions .x > size_max || bbox_object .shape .dimensions .y > size_max ||
245
- bbox_object .shape .dimensions .z > size_max) {
241
+ object .shape .dimensions .x > size_max || object .shape .dimensions .y > size_max ||
242
+ object .shape .dimensions .z > size_max) {
246
243
return false ;
247
244
} else if (
248
- bbox_object .shape .dimensions .x < size_min || bbox_object .shape .dimensions .y < size_min ||
249
- bbox_object .shape .dimensions .z < size_min) {
245
+ object .shape .dimensions .x < size_min || object .shape .dimensions .y < size_min ||
246
+ object .shape .dimensions .z < size_min) {
250
247
return false ;
251
248
}
252
249
253
250
// update object size
254
251
constexpr double gain = 0.1 ;
255
252
constexpr double gain_inv = 1.0 - gain;
256
- bounding_box_.length = gain_inv * bounding_box_.length + gain * bbox_object .shape .dimensions .x ;
257
- bounding_box_.width = gain_inv * bounding_box_.width + gain * bbox_object .shape .dimensions .y ;
258
- bounding_box_.height = gain_inv * bounding_box_.height + gain * bbox_object .shape .dimensions .z ;
253
+ bounding_box_.length = gain_inv * bounding_box_.length + gain * object .shape .dimensions .x ;
254
+ bounding_box_.width = gain_inv * bounding_box_.width + gain * object .shape .dimensions .y ;
255
+ bounding_box_.height = gain_inv * bounding_box_.height + gain * object .shape .dimensions .z ;
259
256
260
257
// set maximum and minimum size
261
258
constexpr double max_size = 5.0 ;
0 commit comments