@@ -165,30 +165,16 @@ boost::optional<TurnSignalInfo> TurnSignalDecider::getIntersectionTurnSignalInfo
165
165
const std::string lane_attribute =
166
166
current_lane.attributeOr (" turn_direction" , std::string (" none" ));
167
167
168
- // check next lanes
169
- auto next_lanes = route_handler. getNextLanelets (current_lane) ;
170
- if (next_lanes. empty ( )) {
168
+ // check next lane has the same attribute
169
+ lanelet::ConstLanelet next_lane{} ;
170
+ if (!route_handler. getNextLaneletWithinRoute (current_lane, &next_lane )) {
171
171
break ;
172
172
}
173
-
174
- // filter next lanes with same attribute in the path
175
- std::vector<lanelet::ConstLanelet> next_lanes_in_path{};
176
- std::copy_if (
177
- next_lanes.begin (), next_lanes.end (), std::back_inserter (next_lanes_in_path),
178
- [&](const auto & next_lane) {
179
- const bool is_in_unique_ids =
180
- std::find (unique_lane_ids.begin (), unique_lane_ids.end (), next_lane.id ()) !=
181
- unique_lane_ids.end ();
182
- const bool has_same_attribute =
183
- next_lane.attributeOr (" turn_direction" , std::string (" none" )) == lane_attribute;
184
- return is_in_unique_ids && has_same_attribute;
185
- });
186
- if (next_lanes_in_path.empty ()) {
173
+ if (next_lane.attributeOr (" turn_direction" , std::string (" none" )) != lane_attribute) {
187
174
break ;
188
175
}
189
176
190
- // assume that the next lane in the path is only one
191
- current_lane = next_lanes_in_path.front ();
177
+ current_lane = next_lane;
192
178
}
193
179
194
180
if (!combined_lane_elems.empty ()) {
0 commit comments