Skip to content

Commit ca51288

Browse files
committed
feat: improve lanelet search logic in getPredictedReferencePath()
1 parent 4cb6aff commit ca51288

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
@@ -1635,6 +1635,15 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
16351635
if (!unconnected_lanelets.empty()) {
16361636
return unconnected_lanelets.front();
16371637
}
1638+
// search side of the next lanelet
1639+
const lanelet::ConstLanelets next_lanelet = routing_graph_ptr_->following(lanelet);
1640+
if (!next_lanelet.empty()) {
1641+
const auto next = get_left ? routing_graph_ptr_->left(next_lanelet.front())
1642+
: routing_graph_ptr_->right(next_lanelet.front());
1643+
if (!!next) {
1644+
return *next;
1645+
}
1646+
}
16381647
}
16391648

16401649
// if no candidate lanelet found, return empty

0 commit comments

Comments
 (0)