From bf2bcb56b53e42337d922383339f89ccd9396c54 Mon Sep 17 00:00:00 2001 From: Louis-Guillaume DUBOIS Date: Thu, 7 May 2015 23:59:49 +0200 Subject: [PATCH] adds fabs() to test in commande --- launch/commande.launch | 5 ----- launch/essai-commande.launch | 25 +++++++++++++++++++++++++ src/commande.cpp | 4 ++-- 3 files changed, 27 insertions(+), 7 deletions(-) delete mode 100644 launch/commande.launch create mode 100644 launch/essai-commande.launch diff --git a/launch/commande.launch b/launch/commande.launch deleted file mode 100644 index b67caee..0000000 --- a/launch/commande.launch +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/launch/essai-commande.launch b/launch/essai-commande.launch new file mode 100644 index 0000000..0e5e51d --- /dev/null +++ b/launch/essai-commande.launch @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/commande.cpp b/src/commande.cpp index ff92355..904c682 100644 --- a/src/commande.cpp +++ b/src/commande.cpp @@ -42,12 +42,12 @@ class Run mvt->linear.z = dz * z_vel; ROS_INFO("z changed"); } - if (xx > x_dev_min) + if (fabs(xx) > x_dev_min) { mvt->linear.y = xx * plan_vel; // because of the kinect orientation } - if (yy > y_dev_min) + if (fabs(yy) > y_dev_min) { mvt->linear.x = yy * plan_vel; // because of the kinect orientation