Skip to content

Commit

Permalink
feat(goal_planner): cut stop path to goal
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 committed Jan 6, 2025
1 parent a32cae1 commit e6b5233
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,10 @@ PathWithLaneId GoalPlannerModule::generateStopPath(
const auto reference_path = std::invoke([&]() -> PathWithLaneId {
const auto s_current = lanelet::utils::getArcCoordinates(current_lanes, current_pose).length;
const double s_start = std::max(0.0, s_current - common_parameters.backward_path_length);
const double s_end = s_current + common_parameters.forward_path_length;
const double s_end = std::clamp(
lanelet::utils::getArcCoordinates(current_lanes, route_handler->getGoalPose()).length,
s_current + std::numeric_limits<double>::epsilon(),
s_current + common_parameters.forward_path_length);

Check warning on line 1679 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

GoalPlannerModule::generateStopPath already has high cyclomatic complexity, and now it increases in Lines of Code from 72 to 75. 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 1679 in planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/goal_planner_module.cpp#L1677-L1679

Added lines #L1677 - L1679 were not covered by tests
return route_handler->getCenterLinePath(current_lanes, s_start, s_end, true);
});

Expand Down

0 comments on commit e6b5233

Please sign in to comment.