From cbe3cda59b721f90a0ba1f0fd7465289277879a4 Mon Sep 17 00:00:00 2001
From: Johannes Mey <johannes.mey@tu-dresden.de>
Date: Tue, 21 Jul 2020 01:18:24 +0200
Subject: [PATCH] regularly publish zone status, even if it does not change

---
 src/SafetyZoneMonitor.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/SafetyZoneMonitor.h b/src/SafetyZoneMonitor.h
index 85ff823..3731521 100644
--- a/src/SafetyZoneMonitor.h
+++ b/src/SafetyZoneMonitor.h
@@ -59,7 +59,7 @@ public:
         for (auto zone : zones) {
           if (zone.contains(msg.pose.at(link_number).position)) {
             // the point is contained in the zone, so we can stop checking and send an according message
-            if (!res || !initialized) {
+            if ((counter%100==1) || !res || !initialized) {
               initialized = true;
               res = true;
               panda_mqtt_connector::StampedInZone result;
@@ -74,7 +74,7 @@ public:
       }
     }
     // no part of the robot is in a zone
-    if (res || !initialized) {
+    if ((counter%100==1) || res || !initialized) {
       ROS_INFO_STREAM("left zone in run " << counter);
       initialized = true;
       res = false;
-- 
GitLab