Skip to content

Commit

Permalink
Insert stop point if object is coming from rear
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
  • Loading branch information
zulfaqar-azmi-t4 committed Aug 6, 2024
1 parent 87e6b52 commit 775c85e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ bool LaneChangeInterface::canTransitFailureState()

if (post_process_safety_status_.is_safe) {
log_debug_throttled("Can't transit to failure state. Ego is on prepare, and it's safe.");

if (module_type_->isRequiredStop(post_process_safety_status_.is_object_coming_from_rear)) {
log_debug_throttled("Module require stopping");
}

Check warning on line 302 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/interface.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

LaneChangeInterface::canTransitFailureState increases in cyclomatic complexity from 21 to 23, 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.

Check warning on line 302 in planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/interface.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Bumpy Road Ahead

LaneChangeInterface::canTransitFailureState has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
return false;
}

Expand Down

0 comments on commit 775c85e

Please sign in to comment.