commit c840fbe6010d985645048bfcd7eb61c4739bdaf8
Author: Priya <pdeo@Phlegethon.(none)>
Date:   Sun Dec 2 19:36:52 2012 -0500

    Changed linefollowing so that turns start working once again. Also fixed some bugs with maze solving.

diff --git a/scout/libscout/src/behaviors/line_follow.cpp b/scout/libscout/src/behaviors/line_follow.cpp
index 9a17f90..c2e12ef 100644
--- a/scout/libscout/src/behaviors/line_follow.cpp
+++ b/scout/libscout/src/behaviors/line_follow.cpp
@@ -30,7 +30,7 @@ using namespace std;
 static int motor_l;
 static int motor_r;
 
-Duration init_turn_time(0.5);
+Duration init_turn_time(1.5);
 
 void line_follow::follow_line()
 {
@@ -67,7 +67,7 @@ void line_follow::turn_left()
   do
   {
     motor_l = -MOTOR_BASE;
-    motor_r = MOTOR_BASE/8;
+    motor_r = 3*MOTOR_BASE/5;
 
     motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
 
@@ -100,8 +100,11 @@ void line_follow::spot_turn()
 
     if(first)
     {
-        while(line_loc < 2 && line_loc > -2)
+        do
+        {
           line_loc = linesensor->readline();
+        }
+        while(line_loc < 2 && line_loc > -2);
 
         first = false;
     }
@@ -116,7 +119,7 @@ void line_follow::turn_right()
   float line_loc;
   do
   {
-    motor_l = MOTOR_BASE/8;
+    motor_l = 3*MOTOR_BASE/5;
     motor_r = -MOTOR_BASE;
 
     motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
diff --git a/scout/libscout/src/behaviors/line_follow.h b/scout/libscout/src/behaviors/line_follow.h
index 93b261a..f7d23cc 100644
--- a/scout/libscout/src/behaviors/line_follow.h
+++ b/scout/libscout/src/behaviors/line_follow.h
@@ -29,8 +29,8 @@
 #include "../Behavior.h"
 #include "../Sensors.h"
 
-#define MOTOR_BASE 60.0f
-#define SCALE 60.0f
+#define MOTOR_BASE 40.0f
+#define SCALE 40.0f
 
 class line_follow : public Behavior
 {
diff --git a/scout/libscout/src/behaviors/maze_solve.cpp b/scout/libscout/src/behaviors/maze_solve.cpp
index 7d22994..1efd7a7 100644
--- a/scout/libscout/src/behaviors/maze_solve.cpp
+++ b/scout/libscout/src/behaviors/maze_solve.cpp
@@ -43,6 +43,8 @@ using namespace std;
 #define DOWN 2
 #define LEFT 3
 
+Duration sonar_update_time(1.0);
+
 void maze_solve::run(){
     
     // TODO:first initialize map to all 0's
@@ -73,10 +75,15 @@ bool maze_solve::solve(int row, int col, int dir)
 {
     int initial_dir = dir;
 
+    ROS_INFO("I am at direction %d", dir);
+
     // use backtracking to solve the maze
     if (at_destination())
         return true;
 
+    // Wait for sonar to update.
+    sonar_update_time.sleep();
+
     // this function should fill the adjacent cells around me with
     // wall's or paths
     while(!look_around(row, col, dir) && ok())
@@ -85,9 +92,9 @@ bool maze_solve::solve(int row, int col, int dir)
     }
 
     /* try go up */
-    ROS_INFO("GOING UP!");
     if (map[row-1][col] != WALL && initial_dir != UP)
     {
+    ROS_INFO("GOING UP!");
         // Turn up.
         turn_from_to(dir, UP);
         follow_line();
@@ -104,9 +111,9 @@ bool maze_solve::solve(int row, int col, int dir)
         }
     }
     /* try right */
-    ROS_INFO("GOING RIGHT!");
     if (map[row][col+1] != WALL && initial_dir != RIGHT)
     {
+    ROS_INFO("GOING RIGHT!");
         // Turn right.
         turn_from_to(dir, RIGHT);
         follow_line();
@@ -123,9 +130,9 @@ bool maze_solve::solve(int row, int col, int dir)
         }
     }
     /* try down */
-    ROS_INFO("GOING DOWN!");
     if (map[row+1][col] != WALL && initial_dir != DOWN)
     {
+    ROS_INFO("GOING DOWN!");
         // Turn down.
         turn_from_to(dir, DOWN);
         follow_line();
@@ -142,9 +149,9 @@ bool maze_solve::solve(int row, int col, int dir)
         }
     }
     /* try left */
-    ROS_INFO("GOING LEFT!");
     if (map[row][col-1] != WALL && initial_dir != LEFT)
     {
+    ROS_INFO("GOING LEFT!");
         // Turn down.
         turn_from_to(dir, LEFT);
         follow_line();
@@ -176,13 +183,13 @@ void maze_solve::turn_from_to(int current_dir, int intended_dir) {
             spot_turn();
             break;
         case 1:
-            turn_right();
+            turn_left();
             break;
         case 2:
             turn_straight();
             break;
         case 3:
-            turn_left();
+            turn_right();
             break;
     }
 }
