new filter satisfying LGD's requirements

This commit is contained in:
Paul Janin 2015-05-22 17:36:22 +02:00
commit 68ada0a28c
2 changed files with 11 additions and 5 deletions

View file

@ -17,8 +17,8 @@ class Run
private: private:
float xx, yy, dz; float xx, yy, dz;
// xx > 0 : forward // xx < 0 : forward
// xx < 0 : backward // xx > 0 : backward
// yy > 0 : right // yy > 0 : right
// yy < 0 : left // yy < 0 : left
@ -56,12 +56,10 @@ class Run
if (fabs(yy) > fabs(xx) && fabs(yy) > y_dev_min) if (fabs(yy) > fabs(xx) && fabs(yy) > y_dev_min)
{ {
mvt->linear.y = yy * plan_vel; mvt->linear.y = yy * plan_vel;
mvt->linear.x = 0.;
} }
else if (fabs(xx) > x_dev_min) else if (fabs(xx) > x_dev_min)
{ {
mvt->linear.x = xx * plan_vel; mvt->linear.x = - xx * plan_vel;
mvt->linear.y = 0.;
} }
assert(mvt->linear.x == 0. || mvt->linear.y == 0.); assert(mvt->linear.x == 0. || mvt->linear.y == 0.);

View file

@ -68,14 +68,22 @@ class Callback {
return std::min(diff1, diff2); return std::min(diff1, diff2);
} }
<<<<<<< HEAD
float sat(const Point& pt) float sat(const Point& pt)
=======
float sat_dist(const Point& pt)
>>>>>>> 016c5b01c8e2d4513b333d32b0e0689e985e6776
{ {
float h, s, v, diff1, diff2; float h, s, v, diff1, diff2;
pcl::tracking::RGB2HSV(pt.r, pt.g, pt.b, h, s, v); pcl::tracking::RGB2HSV(pt.r, pt.g, pt.b, h, s, v);
return s; return s;
} }
<<<<<<< HEAD
float val(const Point& pt) float val(const Point& pt)
=======
float val_dist(const Point& pt)
>>>>>>> 016c5b01c8e2d4513b333d32b0e0689e985e6776
{ {
float h, s, v, diff1, diff2; float h, s, v, diff1, diff2;
pcl::tracking::RGB2HSV(pt.r, pt.g, pt.b, h, s, v); pcl::tracking::RGB2HSV(pt.r, pt.g, pt.b, h, s, v);