corrects hue distance in «filtre» node

This commit is contained in:
Louis-Guillaume DUBOIS 2015-05-07 17:49:25 +02:00
parent 2897943e42
commit f741c60e12
2 changed files with 4 additions and 4 deletions

View file

@ -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);
}
};

View file

@ -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;