]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Trgen: Cosmetic fixes
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 16 Feb 2009 07:29:40 +0000 (08:29 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 16 Feb 2009 07:29:40 +0000 (08:29 +0100)
src/motion/trgen.cc

index f996b4b401b79399a773ca0ad0f48132b9ae9da9..b5faf93f030ca9ca2aa0b1f884ab885212b17088 100644 (file)
@@ -459,7 +459,7 @@ public:
 
 
     /**
-     * counts anglular direction of robot
+     * Calculates tangential direction of the robot
      */
     double getAngleAt(double distance) {
         double par;
@@ -470,15 +470,7 @@ public:
         x_ = 5*Ax*pow(par, 4) + 4*Bx*pow(par, 3) + 3*Cx*pow(par, 2) + 2*Dx*par + Ex;
         y_ = 5*Ay*pow(par, 4) + 4*By*pow(par, 3) + 3*Cy*pow(par, 2) + 2*Dy*par + Ey;
 
-        if (x_ == 0 && y_ > 0)
-            phi = M_PI/2;
-        if (x_ == 0 && y_ > 0)
-            phi = -M_PI/2;
-        if (x_ != 0)
-            {
-            phi = atan2(y_, x_);
-            }
-
+       phi = atan2(y_, x_);
         return phi;
     }
 
@@ -1059,7 +1051,7 @@ Trajectory::calcSpeeds()
         if (v1 > lastv) {
             v1 = lastv;
 
-            if ((*seg)->isSpline() == 0) {
+            if ((*seg)->isSpline() == false) {
                 double l = (*seg)->getUnifiedLength();
                 double a = (*seg)->getMaxAcc(constr);
                 double t;
@@ -1104,7 +1096,7 @@ Trajectory::calcSpeeds()
         if (v2 > lastv) {
             v2 = lastv;
 
-            if ((*seg)->isSpline() == 0) {
+            if ((*seg)->isSpline() == false) {
                 double l = (*seg)->getUnifiedLength();
                 double a = (*seg)->getMaxAcc(constr);
                 double t;