commit 754da79f59a021f22a2ce09dae007b7d85a2521e
Author: Priya <pdeo@Phlegethon.(none)>
Date:   Sun Dec 2 17:18:39 2012 -0500

    Added the behavior to behavior list and cmakelists and made things compile.

diff --git a/scout/libscout/CMakeLists.txt b/scout/libscout/CMakeLists.txt
index 2070680..ea24339 100644
--- a/scout/libscout/CMakeLists.txt
+++ b/scout/libscout/CMakeLists.txt
@@ -32,7 +32,7 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
 set(MAIN_FILES src/Sensors.cpp src/Behavior.cpp src/BehaviorList.cpp src/BehaviorProcess.cpp)
 set(BEHAVIOR_FILES src/behaviors/Odometry.cpp src/behaviors/draw_cw_circle.cpp src/behaviors/draw_ccw_circle.cpp src/behaviors/navigationMap.cpp src/behaviors/line_follow.cpp src/behaviors/wl_test.cpp src/behaviors/pause_scout.cpp)
 
-set(TEST_BEHAVIOR_FILES src/behaviors/Scheduler.cpp src/behaviors/WH_Robot.cpp)
+set(TEST_BEHAVIOR_FILES src/behaviors/Scheduler.cpp src/behaviors/WH_Robot.cpp src/behaviors/maze_solve.cpp)
 set(HELPER_FILES src/helper_classes/Order.cpp src/helper_classes/PQWrapper.cpp)
 set(CONTROL_CLASSES src/MotorControl.cpp src/SonarControl.cpp src/HeadlightControl.cpp src/ButtonControl.cpp src/WirelessSender.cpp src/WirelessReceiver.cpp src/EncodersControl.cpp src/LinesensorControl.cpp)
 
diff --git a/scout/libscout/src/BehaviorList.cpp b/scout/libscout/src/BehaviorList.cpp
index ee17269..a39a298 100644
--- a/scout/libscout/src/BehaviorList.cpp
+++ b/scout/libscout/src/BehaviorList.cpp
@@ -12,6 +12,7 @@ BehaviorList::BehaviorList(std::string scoutname, Sensors * sensor)
   behavior_list.push_back((Behavior*)new WH_Robot(scoutname, sensor));
   behavior_list.push_back((Behavior*)new line_follow(scoutname, sensor));
   behavior_list.push_back((Behavior*)new wl_test(scoutname, sensor));
+  behavior_list.push_back((Behavior*)new maze_solve(scoutname, sensor));
   return;
 }
 
diff --git a/scout/libscout/src/BehaviorList.h b/scout/libscout/src/BehaviorList.h
index 0d5cec7..a27e9bd 100644
--- a/scout/libscout/src/BehaviorList.h
+++ b/scout/libscout/src/BehaviorList.h
@@ -11,6 +11,7 @@
 #include "behaviors/WH_Robot.h"
 #include "behaviors/wl_test.h"
 #include "behaviors/pause_scout.h"
+#include "behaviors/maze_solve.h"
 #include "Sensors.h"
 
 class BehaviorList
diff --git a/scout/libscout/src/behaviors/line_follow.h b/scout/libscout/src/behaviors/line_follow.h
index a6c929a..93b261a 100644
--- a/scout/libscout/src/behaviors/line_follow.h
+++ b/scout/libscout/src/behaviors/line_follow.h
@@ -35,6 +35,9 @@
 class line_follow : public Behavior
 {
     public:
+        line_follow(std::string scoutname, std::string behavior_name, Sensors* sensors) : 
+                Behavior(scoutname, behavior_name, sensors) {};
+
         line_follow(std::string scoutname, Sensors* sensors) : 
                 Behavior(scoutname, "line_follow", sensors) {};
 
diff --git a/scout/libscout/src/behaviors/maze_solve.cpp b/scout/libscout/src/behaviors/maze_solve.cpp
index c5c9924..5e2d773 100644
--- a/scout/libscout/src/behaviors/maze_solve.cpp
+++ b/scout/libscout/src/behaviors/maze_solve.cpp
@@ -33,7 +33,6 @@ using namespace std;
 // we assume we are facing right, that affects where we store
 // wall information
 // -1 for wall, 0 for unseen, 1 for traveled, 2 for critical
-static int map[60][60];
 #define WALL -1
 #define UNSEEN 0
 #define SEEN 1
@@ -43,6 +42,7 @@ static int map[60][60];
 #define RIGHT 1
 #define DOWN 2
 #define LEFT 3
+
 void maze_solve::run(){
     
     // TODO:first initialize map to all 0's
@@ -51,7 +51,7 @@ void maze_solve::run(){
 
 bool maze_solve::solve(int row, int col, int dir)
 {
-    int intial_dir = dir;
+    int initial_dir = dir;
 
     // use backtracking to solve the maze
     if (at_destination())
@@ -66,7 +66,7 @@ bool maze_solve::solve(int row, int col, int dir)
     {
         // Turn up.
         turn_from_to(dir, UP);
-        line_follow();
+        follow_line();
         // Solve recursively.
         bool solved = solve(row-1, col, DOWN);
         if (solved)
@@ -84,7 +84,7 @@ bool maze_solve::solve(int row, int col, int dir)
     {
         // Turn right.
         turn_from_to(dir, RIGHT);
-        line_follow();
+        follow_line();
         // Solve recursively.
         bool solved = solve(row, col+1, LEFT);
         if (solved)
@@ -102,7 +102,7 @@ bool maze_solve::solve(int row, int col, int dir)
     {
         // Turn down.
         turn_from_to(dir, DOWN);
-        line_follow();
+        follow_line();
         // Solve recursively.
         bool solved = solve(row+1, col, UP);
         if (solved)
@@ -120,7 +120,7 @@ bool maze_solve::solve(int row, int col, int dir)
     {
         // Turn down.
         turn_from_to(dir, LEFT);
-        line_follow();
+        follow_line();
         // Solve recursively.
         bool solved = solve(row, col-1, RIGHT);
         if (solved)
@@ -136,7 +136,7 @@ bool maze_solve::solve(int row, int col, int dir)
     // we have exhausted all the options. This path is clearly a
     // dead end. go back to where we come from and return false.
     turn_from_to(dir, initial_dir);
-    line_follow();
+    follow_line();
     return false;
 }
 
@@ -144,6 +144,7 @@ bool maze_solve::solve(int row, int col, int dir)
 // into it intended direction
 void maze_solve::turn_from_to(int current_dir, int intended_dir) {
     switch ((4 + intended_dir - current_dir) % 4) 
+    {
         case 0:
             spot_turn();
             break;
@@ -156,6 +157,7 @@ void maze_solve::turn_from_to(int current_dir, int intended_dir) {
         case 3:
             turn_left();
             break;
+    }
 }
 
 void maze_solve::look_around(int row, int col, int dir)
@@ -165,7 +167,7 @@ void maze_solve::look_around(int row, int col, int dir)
     // there is a wall into the map
     // stores at row col 2 if point is critical, 1 otherwise
     
-    int* readings = get_sonar_readings();
+    int* readings = sonar->get_sonar_readings();
 
     // Look to the right.
     int right_distance = (readings[1] + readings[0] + readings[47])/3;
diff --git a/scout/libscout/src/behaviors/maze_solve.h b/scout/libscout/src/behaviors/maze_solve.h
index 60f5421..afb0f11 100644
--- a/scout/libscout/src/behaviors/maze_solve.h
+++ b/scout/libscout/src/behaviors/maze_solve.h
@@ -26,7 +26,7 @@
 #ifndef _MAZE_SOLVE_H_
 #define _MAZE_SOLVE_H_
 
-#include "../Behavior.h"
+#include "line_follow.h"
 
 class maze_solve: public line_follow
 {
@@ -39,6 +39,8 @@ class maze_solve: public line_follow
         void turn_from_to(int current_dir, int intended_dir);
         void look_around(int row, int col, int dir);
         bool at_destination();
-}
+
+        int map[60][60];
+};
 #endif
 
