From 7787016df783e74e320b22858c0132738d7037b6 Mon Sep 17 00:00:00 2001 From: Ryuta Kambe Date: Wed, 26 Jun 2024 11:44:40 +0900 Subject: [PATCH] fix(radar_object_tracker): fix duplicateBranch warning Signed-off-by: Ryuta Kambe --- .../tracker/model/linear_motion_tracker.cpp | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp b/perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp index 1bc548fa7a951..48cfbd242f48d 100644 --- a/perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp +++ b/perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp @@ -138,21 +138,19 @@ LinearMotionTracker::LinearMotionTracker( P_v_xy = R * P_v_xy_local * R.transpose(); } // acceleration covariance often written in object frame - const bool has_acceleration_covariance = - false; // currently message does not have acceleration covariance - if (has_acceleration_covariance) { - // const auto ax_cov = - // object.kinematics.acceleration_with_covariance.covariance[utils::MSG_COV_IDX::X_X]; // This - // is future update - // const auto ay_cov = - // object.kinematics.acceleration_with_covariance.covariance[utils::MSG_COV_IDX::Y_Y]; // This - // is future update - // Eigen::Matrix2d P_a_xy_local; - // P_a_xy_local << ax_cov, 0.0, 0.0, ay_cov; - P_a_xy = R * P_a_xy_local * R.transpose(); - } else { - P_a_xy = R * P_a_xy_local * R.transpose(); - } + // if message has acceleration covariance, + // ``` + // const auto ax_cov = + // object.kinematics.acceleration_with_covariance.covariance[utils::MSG_COV_IDX::X_X]; + // // This is future update + // const auto ay_cov = + // object.kinematics.acceleration_with_covariance.covariance[utils::MSG_COV_IDX::Y_Y]; + // // This is future update + // Eigen::Matrix2d P_a_xy_local; + // P_a_xy_local << ax_cov, 0.0, 0.0, ay_cov; + // P_a_xy = R * P_a_xy_local * R.transpose(); + // ``` + P_a_xy = R * P_a_xy_local * R.transpose(); // put value in P matrix // use block description. This assume x,y,vx,vy,ax,ay in this order