Skip to content

Commit 5fc4d6a

Browse files
move the cheap/fast check first to possibly boost performance
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent eba2c03 commit 5fc4d6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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
@@ -376,7 +376,7 @@ PathWithLaneId LaneDepartureChecker::cropPointsOutsideOfLanes(
376376
const auto vehicle_footprints = createVehicleFootprints(path);
377377
size_t idx = 0;
378378
std::for_each(vehicle_footprints.begin(), vehicle_footprints.end(), [&](const auto & footprint) {
379-
if (boost::geometry::within(footprint, fused_lanelets_polygon.value()) || idx > end_index) {
379+
if (idx > end_index || boost::geometry::within(footprint, fused_lanelets_polygon.value())) {
380380
temp_path.points.push_back(path.points.at(idx));
381381
}
382382
++idx;

0 commit comments

Comments
 (0)