Skip to content

Commit 5de95b0

Browse files
committed
feat: improve lanelet search logic in getPredictedReferencePath()
1 parent b864937 commit 5de95b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

perception/map_based_prediction/src/map_based_prediction_node.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,15 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
15501550
if (!unconnected_lanelets.empty()) {
15511551
return unconnected_lanelets.front();
15521552
}
1553+
// search side of the next lanelet
1554+
const lanelet::ConstLanelets next_lanelet = routing_graph_ptr_->following(lanelet);
1555+
if (!next_lanelet.empty()) {
1556+
const auto next = get_left ? routing_graph_ptr_->left(next_lanelet.front())
1557+
: routing_graph_ptr_->right(next_lanelet.front());
1558+
if (!!next) {
1559+
return *next;
1560+
}
1561+
}
15531562
}
15541563

15551564
// if no candidate lanelet found, return empty

0 commit comments

Comments
 (0)