Skip to content

Commit 672d7f5

Browse files
committed
feat: find side lanelet of the next current lanelet
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
1 parent ebc8c7a commit 672d7f5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

perception/autoware_map_based_prediction/src/map_based_prediction_node.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -2037,19 +2037,29 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
20372037
return *opt;
20382038
}
20392039
if (!consider_only_routable_neighbours_) {
2040+
// 1. adjacent lanelet
20402041
const auto adjacent = get_left ? routing_graph_ptr_->adjacentLeft(lanelet)
20412042
: routing_graph_ptr_->adjacentRight(lanelet);
20422043
if (!!adjacent) {
20432044
return *adjacent;
20442045
}
2045-
// search for unconnected lanelet
2046+
// 2. search for unconnected lanelet
20462047
const auto unconnected_lanelets =
20472048
get_left ? getLeftLineSharingLanelets(lanelet, lanelet_map_ptr_)
20482049
: getRightLineSharingLanelets(lanelet, lanelet_map_ptr_);
20492050
// just return first candidate of unconnected lanelet for now
20502051
if (!unconnected_lanelets.empty()) {
20512052
return unconnected_lanelets.front();
20522053
}
2054+
// 3. search side of the next lanelet
2055+
const lanelet::ConstLanelets next_lanelet = routing_graph_ptr_->following(lanelet);
2056+
if (!next_lanelet.empty()) {
2057+
const auto next = get_left ? routing_graph_ptr_->left(next_lanelet.front())
2058+
: routing_graph_ptr_->right(next_lanelet.front());
2059+
if (!!next) {
2060+
return *next;
2061+
}
2062+
}
20532063
}
20542064

20552065
// if no candidate lanelet found, return empty

0 commit comments

Comments
 (0)