From: Michal Vokac Date: Fri, 9 Dec 2011 16:05:56 +0000 (+0100) Subject: robofsm: Add constant for close target value. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/eurobot/public.git/commitdiff_plain/7b4da59ce9a2c6f76c08833652ac9a90d0e61b1a robofsm: Add constant for close target value. --- diff --git a/src/robofsm/common-states.cc b/src/robofsm/common-states.cc index ffa357e6..e908c758 100644 --- a/src/robofsm/common-states.cc +++ b/src/robofsm/common-states.cc @@ -62,10 +62,11 @@ bool goal_is_in_playground(double goalx, double goaly) /* Check if the new point is close to the robot */ bool close_goal(double goalx, double goaly) { + const double close = 0.5; double x, y, phi; robot_get_est_pos(&x, &y, &phi); - if ((abs(goalx - x) < 0.5) && (abs(goaly - y) < 0.5) ) + if ((abs(goalx - x) < close) && (abs(goaly - y) < close) ) return true; else return false;