From f741c60e12e2f2a4e504dde4e4226e1b3d46f93e Mon Sep 17 00:00:00 2001 From: Louis-Guillaume DUBOIS Date: Thu, 7 May 2015 17:49:25 +0200 Subject: [PATCH] =?UTF-8?q?corrects=20hue=20distance=20in=20=C2=ABfiltre?= =?UTF-8?q?=C2=BB=20node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filtre.cpp | 2 +- src/random_pcl_publisher.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/filtre.cpp b/src/filtre.cpp index 541ae03..ec01c19 100644 --- a/src/filtre.cpp +++ b/src/filtre.cpp @@ -61,7 +61,7 @@ class Callback { diff2 = std::fabs(360.0f + h - hue); else diff2 = std::fabs(360.0f + hue - h); - return std::max(diff1, diff2); + return std::min(diff1, diff2); } }; diff --git a/src/random_pcl_publisher.cpp b/src/random_pcl_publisher.cpp index 394f0d9..874a408 100644 --- a/src/random_pcl_publisher.cpp +++ b/src/random_pcl_publisher.cpp @@ -27,9 +27,9 @@ class Generator cgen.fill(length, length, *pcl); for (int i = 0; i < pcl->points.size(); ++i) { - pcl->points[i].r = (uint8_t) 255; - pcl->points[i].g = (uint8_t) 255; - pcl->points[i].b = (uint8_t) 0; + pcl->points[i].r = (uint8_t) 175; + pcl->points[i].g = (uint8_t) 120; + pcl->points[i].b = (uint8_t) 118; } ros::Time now = ros::Time::now(); pcl->header.stamp = now.toNSec() / 1000;