Skip to content

Commit

Permalink
fix(radar_object_tracker): fix duplicateBranch warning
Browse files Browse the repository at this point in the history
Signed-off-by: Ryuta Kambe <[email protected]>
  • Loading branch information
veqcc committed Jun 26, 2024
1 parent b67a6c3 commit 7787016
Showing 1 changed file with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Check notice on line 153 in perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Large Method

LinearMotionTracker::LinearMotionTracker decreases from 76 to 70 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.

Check warning on line 153 in perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp

View check run for this annotation

Codecov / codecov/patch

perception/radar_object_tracker/src/tracker/model/linear_motion_tracker.cpp#L153

Added line #L153 was not covered by tests

// put value in P matrix
// use block description. This assume x,y,vx,vy,ax,ay in this order
Expand Down

0 comments on commit 7787016

Please sign in to comment.