65 const auto& first_encountered_overlaps =
66 reference_line_info.FirstEncounteredOverlaps();
68 for (
const auto& overlap : first_encountered_overlaps) {
77 if (traffic_sign_overlap ==
nullptr) {
80 const std::vector<hdmap::PathOverlap>& traffic_light_overlaps =
81 reference_line_info.reference_line().map_path().signal_overlaps();
82 const double start_check_distance =
84 const double adc_front_edge_s = reference_line_info.AdcSlBoundary().end_s();
87 std::vector<hdmap::PathOverlap> next_traffic_lights;
88 static constexpr double kTrafficLightGroupingMaxDist = 2.0;
89 for (
const auto& overlap : traffic_light_overlaps) {
90 const double dist = overlap.start_s - traffic_sign_overlap->
start_s;
91 if (fabs(dist) <= kTrafficLightGroupingMaxDist) {
92 next_traffic_lights.push_back(overlap);
95 bool traffic_light_scenario =
false;
97 for (
const auto& overlap : next_traffic_lights) {
98 const double adc_distance_to_traffic_light =
99 overlap.start_s - adc_front_edge_s;
100 ADEBUG <<
"traffic_light[" << overlap.object_id <<
"] start_s["
101 << overlap.start_s <<
"] adc_distance_to_traffic_light["
102 << adc_distance_to_traffic_light <<
"]";
105 if (adc_distance_to_traffic_light <= 0.0 ||
106 adc_distance_to_traffic_light > start_check_distance) {
110 const auto& signal_color = frame.
GetSignal(overlap.object_id).
color();
111 ADEBUG <<
"traffic_light_id[" << overlap.object_id <<
"] start_s["
112 << overlap.start_s <<
"] color[" << signal_color <<
"]";
116 traffic_light_scenario =
true;
120 if (!traffic_light_scenario) {
124 for (
const auto& overlap : next_traffic_lights) {
std::vector< std::string > current_traffic_light_overlap_ids
ScenarioTrafficLightProtectedConfig scenario_config