Change sign of xx in command-new-1d.cpp to make xx>0 <=> backward

This commit is contained in:
_Luc_ 2015-05-22 19:24:24 +02:00
parent 3d5ab5635c
commit 016c5b01c8

View file

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