Skip to content

Commit

Permalink
perf: PR 7237
Browse files Browse the repository at this point in the history
  • Loading branch information
technolojin committed Oct 21, 2024
1 parent a7e68a1 commit dd1493d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1031,10 +1031,14 @@ void MapBasedPredictionNode::objectsCallback(const TrackedObjects::ConstSharedPt

bool MapBasedPredictionNode::doesPathCrossAnyFence(const PredictedPath & predicted_path)
{
const lanelet::ConstLineStrings3d & all_fences =
lanelet::utils::query::getAllFences(lanelet_map_ptr_);
for (const auto & fence_line : all_fences) {
if (doesPathCrossFence(predicted_path, fence_line)) {
lanelet::BasicLineString2d predicted_path_ls;
for (const auto & p : predicted_path.path)
predicted_path_ls.emplace_back(p.position.x, p.position.y);
const auto candidates =
lanelet_map_ptr_->lineStringLayer.search(lanelet::geometry::boundingBox2d(predicted_path_ls));
for (const auto & candidate : candidates) {
const std::string type = candidate.attributeOr(lanelet::AttributeName::Type, "none");
if (type == "fence" && doesPathCrossFence(predicted_path, candidate)) {
return true;
}
}
Expand Down

0 comments on commit dd1493d

Please sign in to comment.