File tree 1 file changed +11
-1
lines changed
perception/autoware_map_based_prediction/src
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2037,19 +2037,29 @@ std::vector<PredictedRefPath> MapBasedPredictionNode::getPredictedReferencePath(
2037
2037
return *opt;
2038
2038
}
2039
2039
if (!consider_only_routable_neighbours_) {
2040
+ // 1. adjacent lanelet
2040
2041
const auto adjacent = get_left ? routing_graph_ptr_->adjacentLeft (lanelet)
2041
2042
: routing_graph_ptr_->adjacentRight (lanelet);
2042
2043
if (!!adjacent) {
2043
2044
return *adjacent;
2044
2045
}
2045
- // search for unconnected lanelet
2046
+ // 2. search for unconnected lanelet
2046
2047
const auto unconnected_lanelets =
2047
2048
get_left ? getLeftLineSharingLanelets (lanelet, lanelet_map_ptr_)
2048
2049
: getRightLineSharingLanelets (lanelet, lanelet_map_ptr_);
2049
2050
// just return first candidate of unconnected lanelet for now
2050
2051
if (!unconnected_lanelets.empty ()) {
2051
2052
return unconnected_lanelets.front ();
2052
2053
}
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
+ }
2053
2063
}
2054
2064
2055
2065
// if no candidate lanelet found, return empty
You can’t perform that action at this time.
0 commit comments