Skip to content

Commit

Permalink
chore(traffic_light_arbiter): use THROTTLE to prevent obscuring other…
Browse files Browse the repository at this point in the history
… logs (autowarefoundation#4870) (#817)

chore(traffic_light_arbiter): use THROTTLE to prevent obscuring other logs (autowarefoundation#4870)

chore(traffic_light_arbiter): update warning log to use THROTTLE

Signed-off-by: Tomohito Ando <[email protected]>
  • Loading branch information
TomohitoAndo authored Sep 11, 2023
1 parent 34224ed commit 5f32ede
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ void TrafficLightArbiter::arbitrateAndPublish(const builtin_interfaces::msg::Tim
std::unordered_map<lanelet::Id, std::vector<ElementAndPriority>> regulatory_element_signals_map;

if (map_regulatory_elements_set_ == nullptr) {
RCLCPP_WARN(get_logger(), "Received traffic signal messages before a map");
RCLCPP_WARN_THROTTLE(
get_logger(), *get_clock(), 5000, "Received traffic signal messages before a map");
return;
}

Expand All @@ -126,8 +127,9 @@ void TrafficLightArbiter::arbitrateAndPublish(const builtin_interfaces::msg::Tim
auto add_signal_function = [&](const auto & signal, bool priority) {
const auto id = signal.traffic_signal_id;
if (!map_regulatory_elements_set_->count(id)) {
RCLCPP_WARN(
get_logger(), "Received a traffic signal not present in the current map (%lu)", id);
RCLCPP_WARN_THROTTLE(
get_logger(), *get_clock(), 5000,
"Received a traffic signal not present in the current map (%lu)", id);
return;
}

Expand Down

0 comments on commit 5f32ede

Please sign in to comment.