Skip to content

Commit

Permalink
fix(crosswalk_traffic_light_estimator): fix invalid access (autowaref…
Browse files Browse the repository at this point in the history
…oundation#1825)

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
  • Loading branch information
tkimura4 authored and voltonomous committed Sep 11, 2022
1 parent 1a3c8bd commit 9ee9809
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 9ee9809

Please sign in to comment.