Skip to content

Commit

Permalink
fix(lane_change): transit failure if previous module path empty
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 committed May 30, 2024
1 parent 7bebb1a commit 15a2e25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions planning/behavior_path_lane_change_module/src/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ bool LaneChangeInterface::canTransitFailureState()
updateDebugMarker();
log_debug_throttled(__func__);

if(getPreviousModuleOutput().path.points.empty()){
return true;
}

Check warning on line 231 in planning/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 15 to 16, 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.
if (module_type_->isAbortState() && !module_type_->hasFinishedAbort()) {
log_debug_throttled("Abort process has on going.");
return false;
Expand Down

0 comments on commit 15a2e25

Please sign in to comment.