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) (autowarefoundation#119)

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

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

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
Co-authored-by: Tomoya Kimura <tomoya.kimura@tier4.jp>
  • Loading branch information
1222-takeshi and tkimura4 committed Sep 12, 2022
1 parent 0b04db4 commit 0145055
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 0145055

Please sign in to comment.