Skip to content

Commit

Permalink
feat: improve lanelet search logic in getPredictedReferencePath()
Browse files Browse the repository at this point in the history
  • Loading branch information
technolojin committed Oct 29, 2024
1 parent 4cb6aff commit ca51288
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,15 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
if (!unconnected_lanelets.empty()) {
return unconnected_lanelets.front();
}
// search side of the next lanelet
const lanelet::ConstLanelets next_lanelet = routing_graph_ptr_->following(lanelet);
if (!next_lanelet.empty()) {
const auto next = get_left ? routing_graph_ptr_->left(next_lanelet.front())
: routing_graph_ptr_->right(next_lanelet.front());
if (!!next) {
return *next;
}
}
}

// if no candidate lanelet found, return empty
Expand Down

0 comments on commit ca51288

Please sign in to comment.