Skip to content

Commit 1ffc675

Browse files
add empty polygon and point checks
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent 3a7819f commit 1ffc675

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

control/lane_departure_checker/src/lane_departure_checker_node/lane_departure_checker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ std::optional<lanelet::BasicPolygon2d> LaneDepartureChecker::getFusedLaneletPoly
339339

340340
std::vector<lanelet::BasicPolygon2d> lanelet_union_temp;
341341
boost::geometry::union_(poly, merged_polygon, lanelet_union_temp);
342-
342+
if(lanelet_union_temp.empty()) continue;
343343
// Update merged_polygon by accumulating all merged results
344344
merged_polygon.clear();
345345
for (const auto & temp_poly : lanelet_union_temp) {

planning/behavior_path_start_planner_module/src/shift_pull_out.cpp

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

102-
if (isPullOutPathCollided(pull_out_path, parameters_.shift_collision_check_distance_from_end)) {
103-
continue;
104-
}
105-
106102
// crop backward path
107103
// removes points which are out of lanes up to the start pose.
108104
// this ensures that the backward_path stays within the drivable area when starting from a
@@ -115,9 +111,15 @@ std::optional<PullOutPath> ShiftPullOut::plan(const Pose & start_pose, const Pos
115111
const auto cropped_path = lane_departure_checker_->cropPointsOutsideOfLanes(
116112
lanelet_map_ptr, shift_path, start_segment_idx);
117113

114+
if (cropped_path.points.empty()) continue;
115+
118116
shift_path.points = cropped_path.points;
119117
shift_path.header = planner_data_->route_handler->getRouteHeader();
120118

119+
if (isPullOutPathCollided(pull_out_path, parameters_.shift_collision_check_distance_from_end)) {
120+
continue;
121+
}
122+
121123
return pull_out_path;
122124
}
123125

0 commit comments

Comments
 (0)