Skip to content

Commit b28222b

Browse files
committed
ignore pedestrian traffic light prediction if it is unknown
1 parent d7cc786 commit b28222b

File tree

1 file changed

+8
-0
lines changed
  • perception/autoware_crosswalk_traffic_light_estimator/src

1 file changed

+8
-0
lines changed

perception/autoware_crosswalk_traffic_light_estimator/src/node.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,15 @@ void CrosswalkTrafficLightEstimatorNode::setCrosswalkTrafficSignal(
292292
for (const auto & tl_reg_elem : tl_reg_elems) {
293293
auto id = tl_reg_elem->id();
294294
// if valid prediction exists, overwrite the estimation; else, use the estimation
295+
bool valid_prediction = false;
295296
if (valid_id2idx_map.count(id)) {
297+
size_t idx = valid_id2idx_map[id];
298+
auto signal = msg.traffic_light_groups[idx];
299+
if (output.traffic_light_groups[idx].elements[0].color != TrafficSignalElement::UNKNOWN){
300+
valid_prediction = true;
301+
}
302+
}
303+
if (valid_prediction) {
296304
size_t idx = valid_id2idx_map[id];
297305
auto signal = msg.traffic_light_groups[idx];
298306
updateFlashingState(signal); // check if it is flashing

0 commit comments

Comments
 (0)