Skip to content

Commit

Permalink
fix(traffic_light_arbiter): use the shape as a key to find the highes…
Browse files Browse the repository at this point in the history
…t confidence signal

Signed-off-by: Tomohito Ando <[email protected]>
  • Loading branch information
TomohitoAndo committed Aug 15, 2023
1 parent d6351fc commit 18de990
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ void TrafficLightArbiter::arbitrateAndPublish(const builtin_interfaces::msg::Tim

const auto get_highest_confidence_elements =
[](const std::vector<ElementAndPriority> & elements_and_priority_vector) {
using Key = std::tuple<Element::_color_type, Element::_shape_type>;
using Key = Element::_shape_type;
std::map<Key, ElementAndPriority> highest_score_element_and_priority_map;
std::vector<Element> highest_score_elements_vector;

for (const auto & elements_and_priority : elements_and_priority_vector) {
const auto & element = elements_and_priority.first;
const auto & element_priority = elements_and_priority.second;
const auto key = std::make_tuple(element.color, element.shape);
const auto key = element.shape;
auto [iter, success] =
highest_score_element_and_priority_map.try_emplace(key, elements_and_priority);
const auto & iter_element = iter->second.first;
Expand Down

0 comments on commit 18de990

Please sign in to comment.