Skip to content

Commit 4971240

Browse files
refactor
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent 0fc6d7e commit 4971240

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

planning/behavior_path_start_planner_module/include/behavior_path_start_planner_module/pull_out_planner_base.hpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ class PullOutPlannerBase
6464
virtual std::optional<PullOutPath> plan(const Pose & start_pose, const Pose & goal_pose) = 0;
6565

6666
protected:
67-
bool isPullOutPathCollided(behavior_path_planner::PullOutPath & pull_out_path) const
67+
bool isPullOutPathCollided(
68+
behavior_path_planner::PullOutPath & pull_out_path,
69+
double collision_check_distance_from_end) const
6870
{
6971
// check for collisions
7072
const auto & dynamic_objects = planner_data_->dynamic_object;
@@ -81,12 +83,6 @@ class PullOutPlannerBase
8183
utils::path_safety_checker::filterObjectsByClass(
8284
pull_out_lane_stop_objects, parameters_.object_types_to_check_for_path_generation);
8385

84-
const auto planner_type = getPlannerType();
85-
const double collision_check_distance_from_end =
86-
(planner_type == PlannerType::GEOMETRIC)
87-
? parameters_.geometric_collision_check_distance_from_end
88-
: parameters_.shift_collision_check_distance_from_end;
89-
9086
return utils::checkCollisionBetweenPathFootprintsAndObjects(
9187
vehicle_footprint_,
9288
behavior_path_planner::start_planner_utils::extractCollisionCheckSection(

planning/behavior_path_start_planner_module/src/geometric_pull_out.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ std::optional<PullOutPath> GeometricPullOut::plan(const Pose & start_pose, const
114114
output.start_pose = planner_.getArcPaths().at(0).points.front().point.pose;
115115
output.end_pose = planner_.getArcPaths().at(1).points.back().point.pose;
116116

117-
if (isPullOutPathCollided(output)) {
117+
if (isPullOutPathCollided(output, parameters_.geometric_collision_check_distance_from_end)) {
118118
return {};
119119
}
120120

planning/behavior_path_start_planner_module/src/shift_pull_out.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ std::optional<PullOutPath> ShiftPullOut::plan(const Pose & start_pose, const Pos
9999
continue;
100100
}
101101

102-
if (isPullOutPathCollided(pull_out_path)) {
102+
if (isPullOutPathCollided(pull_out_path, parameters_.shift_collision_check_distance_from_end)) {
103103
continue;
104104
}
105105

0 commit comments

Comments
 (0)