From 3575ac11cdae76aba0b678bad6930e74b9316630 Mon Sep 17 00:00:00 2001 From: Toshiki Nakamura <82020865+ToshikiNakamura0412@users.noreply.github.com> Date: Sun, 28 Jul 2024 22:15:25 +0900 Subject: [PATCH] Fix bug related to count reset (#29) --- src/virtual_road_projector.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/virtual_road_projector.cpp b/src/virtual_road_projector.cpp index 09ee2f2..2f3621b 100644 --- a/src/virtual_road_projector.cpp +++ b/src/virtual_road_projector.cpp @@ -29,7 +29,10 @@ void VirtualRoadProjector::map_callback(const nav_msgs::OccupancyGridConstPtr &m if (!road_updated_) count_of_not_received_road_++; if (param_.allowable_num_of_not_received < count_of_not_received_road_) + { road_.reset(); + count_of_not_received_road_ = 0; + } if (!road_.has_value()) map_pub_.publish(*msg);