Skip to content

Commit 51a74c6

Browse files
authored
fix(autoware_multi_object_tracker): fix bugprone-errors (#9651)
fix: bugprone-errors Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
1 parent 496fb5e commit 51a74c6

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

perception/autoware_multi_object_tracker/lib/tracker/model/bicycle_tracker.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,8 @@ bool BicycleTracker::measureWithShape(const autoware_perception_msgs::msg::Detec
208208
constexpr double size_min = 0.1; // [m]
209209
if (
210210
object.shape.dimensions.x > size_max || object.shape.dimensions.y > size_max ||
211-
object.shape.dimensions.z > size_max) {
212-
return false;
213-
} else if (
214-
object.shape.dimensions.x < size_min || object.shape.dimensions.y < size_min ||
215-
object.shape.dimensions.z < size_min) {
211+
object.shape.dimensions.z > size_max || object.shape.dimensions.x < size_min ||
212+
object.shape.dimensions.y < size_min || object.shape.dimensions.z < size_min) {
216213
return false;
217214
}
218215

perception/autoware_multi_object_tracker/lib/tracker/motion_model/bicycle_motion_model.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ bool BicycleMotionModel::predictStateStep(const double dt, KalmanFilter & ekf) c
315315
double w = vel * sin_slip / lr_;
316316
const double sin_2yaw = std::sin(2.0f * X_t(IDX::YAW));
317317
const double w_dtdt = w * dt * dt;
318-
const double vv_dtdt__lr = vel * vel * dt * dt / lr_;
318+
const double vv_dtdt_lr = vel * vel * dt * dt / lr_;
319319

320320
// Predict state vector X t+1
321321
Eigen::MatrixXd X_next_t(DIM, 1); // predicted state
@@ -332,11 +332,11 @@ bool BicycleMotionModel::predictStateStep(const double dt, KalmanFilter & ekf) c
332332
A(IDX::X, IDX::YAW) = -vel * sin_yaw * dt - 0.5 * vel * cos_yaw * w_dtdt;
333333
A(IDX::X, IDX::VEL) = cos_yaw * dt - sin_yaw * w_dtdt;
334334
A(IDX::X, IDX::SLIP) =
335-
-vel * sin_yaw * dt - 0.5 * (cos_slip * sin_yaw + sin_slip * cos_yaw) * vv_dtdt__lr;
335+
-vel * sin_yaw * dt - 0.5 * (cos_slip * sin_yaw + sin_slip * cos_yaw) * vv_dtdt_lr;
336336
A(IDX::Y, IDX::YAW) = vel * cos_yaw * dt - 0.5 * vel * sin_yaw * w_dtdt;
337337
A(IDX::Y, IDX::VEL) = sin_yaw * dt + cos_yaw * w_dtdt;
338338
A(IDX::Y, IDX::SLIP) =
339-
vel * cos_yaw * dt + 0.5 * (cos_slip * cos_yaw - sin_slip * sin_yaw) * vv_dtdt__lr;
339+
vel * cos_yaw * dt + 0.5 * (cos_slip * cos_yaw - sin_slip * sin_yaw) * vv_dtdt_lr;
340340
A(IDX::YAW, IDX::VEL) = 1.0 / lr_ * sin_slip * dt;
341341
A(IDX::YAW, IDX::SLIP) = vel / lr_ * cos_slip * dt;
342342

perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@ void InputManager::getObjectTimeInterval(
263263
// The default object_earliest_time is to have a 1-second time interval
264264
const rclcpp::Time object_earliest_time_default =
265265
object_latest_time - rclcpp::Duration::from_seconds(1.0);
266-
if (latest_exported_object_time_ < object_earliest_time_default) {
267-
// if the latest exported object time is too old, set to the default
268-
object_earliest_time = object_earliest_time_default;
269-
} else if (latest_exported_object_time_ > object_latest_time) {
270-
// if the latest exported object time is newer than the object_latest_time, set to the default
266+
if (
267+
latest_exported_object_time_ < object_earliest_time_default ||
268+
latest_exported_object_time_ > object_latest_time) {
269+
// if the latest exported object time is too old or newer than the object_latest_time,
270+
// set to the default
271271
object_earliest_time = object_earliest_time_default;
272272
} else {
273273
// The object_earliest_time is the latest exported object time

0 commit comments

Comments
 (0)