@@ -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_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_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_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
@@ -229,8 +227,7 @@ bool BicycleTracker::measureWithPose(const autoware_perception_msgs::msg::Detect
229
227
230
228
bool BicycleTracker::measureWithShape (const autoware_perception_msgs::msg::DetectedObject & object)
231
229
{
232
- autoware_perception_msgs::msg::DetectedObject bbox_object;
233
- if (!object.shape .type == autoware_perception_msgs::msg::Shape::BOUNDING_BOX) {
230
+ if (object.shape .type != autoware_auto_perception_msgs::msg::Shape::BOUNDING_BOX) {
234
231
// do not update shape if the input is not a bounding box
235
232
return false ;
236
233
}
@@ -239,21 +236,21 @@ bool BicycleTracker::measureWithShape(const autoware_perception_msgs::msg::Detec
239
236
constexpr double size_max = 30.0 ; // [m]
240
237
constexpr double size_min = 0.1 ; // [m]
241
238
if (
242
- bbox_object .shape .dimensions .x > size_max || bbox_object .shape .dimensions .y > size_max ||
243
- bbox_object .shape .dimensions .z > size_max) {
239
+ object .shape .dimensions .x > size_max || object .shape .dimensions .y > size_max ||
240
+ object .shape .dimensions .z > size_max) {
244
241
return false ;
245
242
} else if (
246
- bbox_object .shape .dimensions .x < size_min || bbox_object .shape .dimensions .y < size_min ||
247
- bbox_object .shape .dimensions .z < size_min) {
243
+ object .shape .dimensions .x < size_min || object .shape .dimensions .y < size_min ||
244
+ object .shape .dimensions .z < size_min) {
248
245
return false ;
249
246
}
250
247
251
248
// update object size
252
249
constexpr double gain = 0.1 ;
253
250
constexpr double gain_inv = 1.0 - gain;
254
- bounding_box_.length = gain_inv * bounding_box_.length + gain * bbox_object .shape .dimensions .x ;
255
- bounding_box_.width = gain_inv * bounding_box_.width + gain * bbox_object .shape .dimensions .y ;
256
- bounding_box_.height = gain_inv * bounding_box_.height + gain * bbox_object .shape .dimensions .z ;
251
+ bounding_box_.length = gain_inv * bounding_box_.length + gain * object .shape .dimensions .x ;
252
+ bounding_box_.width = gain_inv * bounding_box_.width + gain * object .shape .dimensions .y ;
253
+ bounding_box_.height = gain_inv * bounding_box_.height + gain * object .shape .dimensions .z ;
257
254
258
255
// set maximum and minimum size
259
256
constexpr double max_size = 5.0 ;
0 commit comments