From 15e40fdede4bb5ad7a58f03518924f25004ca7a9 Mon Sep 17 00:00:00 2001
From: Naida Goro <naida.goro@in-tech.com>
Date: Mon, 8 Aug 2022 11:24:21 +0200
Subject: [PATCH] fix(Sensor_OSI): Avoid rounding error in comparison for
 required percentage of visible area

---
 sim/src/components/Sensor_OSI/src/sensorGeometric2D.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sim/src/components/Sensor_OSI/src/sensorGeometric2D.cpp b/sim/src/components/Sensor_OSI/src/sensorGeometric2D.cpp
index 2aa2dbcdc..b4f61dd0e 100644
--- a/sim/src/components/Sensor_OSI/src/sensorGeometric2D.cpp
+++ b/sim/src/components/Sensor_OSI/src/sensorGeometric2D.cpp
@@ -401,7 +401,7 @@ std::pair<std::vector<T>, std::vector<T>> SensorGeometric2D::CalcVisualObstructi
         {
             visibleObjects.emplace_back(*object);
         }
-        if (visiblePercent >= requiredPercentageOfVisibleArea)
+        if (visiblePercent + CommonHelper::EPSILON >= requiredPercentageOfVisibleArea)
         {
             detectedObjects.emplace_back(*object);
         }
-- 
GitLab