From 9a6a05fc8e68f2037dee2899d81e3337ec21de1f Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Wed, 9 Mar 2022 12:01:51 +0100
Subject: [PATCH] Solved a bug with negative x.

---
 src/obstacle_detection_normals_alg.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/obstacle_detection_normals_alg.cpp b/src/obstacle_detection_normals_alg.cpp
index 1f54855..0bdd89d 100644
--- a/src/obstacle_detection_normals_alg.cpp
+++ b/src/obstacle_detection_normals_alg.cpp
@@ -62,7 +62,7 @@ void ObstacleDetectionNormalsAlgorithm::cloud_all(const pcl::PointCloud<pcl::Poi
   {
     for (size_t colIndex=0; colIndex<cloud_out->width; ++colIndex, ++pointIndex)
     {
-      if (cloud_out->points[pointIndex].x > this->config_.filter_min_dist)
+      if (fabs(cloud_out->points[pointIndex].x) > this->config_.filter_min_dist)
       {
         if (fabs(cloud_out->points[pointIndex].normal_z) > cos(this->config_.max_inc))
         {
-- 
GitLab