Skip to content

Commit

Permalink
fix(crosswalk_traffic_light_estimator): fix invalid access (#1825)
Browse files Browse the repository at this point in the history
Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
  • Loading branch information
tkimura4 authored Sep 9, 2022
1 parent a9bc6e6 commit bf4bcce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion perception/crosswalk_traffic_light_estimator/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,15 @@ void CrosswalkTrafficLightEstimatorNode::updateLastDetectedSignal(
last_detect_color_.at(id) = input_traffic_signal.second;
}

std::vector<int32_t> erase_id_list;
for (auto & last_traffic_signal : last_detect_color_) {
const auto & id = last_traffic_signal.second.map_primitive_id;

if (traffic_light_id_map.count(id) == 0) {
last_detect_color_.erase(id);
erase_id_list.emplace_back(id);
}
}
for (const auto id : erase_id_list) last_detect_color_.erase(id);
}

void CrosswalkTrafficLightEstimatorNode::setCrosswalkTrafficSignal(
Expand Down

0 comments on commit bf4bcce

Please sign in to comment.