Skip to content

Commit

Permalink
print average curvature
Browse files Browse the repository at this point in the history
Signed-off-by: Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 committed Dec 26, 2024
1 parent 6ff918e commit 66b4fe2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,10 @@ bool get_prepare_segment(
curvatures.push_back(autoware::universe_utils::calcCurvature(point1, point2, point3));
}

return calc_average_curvature(curvatures) <=
common_data_ptr->lc_param_ptr->trajectory.th_prepare_curvature;
const auto average_curvature = calc_average_curvature(curvatures);

RCLCPP_DEBUG(get_logger(), "average curvature: %.3f", average_curvature);
return average_curvature <= common_data_ptr->lc_param_ptr->trajectory.th_prepare_curvature;

Check warning on line 297 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/path.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Complex Method

get_prepare_segment has a cyclomatic complexity of 10, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
}

LaneChangePath get_candidate_path(
Expand Down

0 comments on commit 66b4fe2

Please sign in to comment.