commit 5837143311f6de5068f1724a2d1dc8377610237d
Author: Priya <pdeo@Phlegethon.(none)>
Date:   Wed Apr 25 23:45:28 2012 -0400

    Renaming to line follow and getting rid of old linefollowing files.

diff --git a/scout/libscout/CMakeLists.txt b/scout/libscout/CMakeLists.txt
index cd53452..ace9a63 100644
--- a/scout/libscout/CMakeLists.txt
+++ b/scout/libscout/CMakeLists.txt
@@ -30,7 +30,7 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
 #target_link_libraries(example ${PROJECT_NAME})
 
 set(MAIN_FILES 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/sim_line.cpp src/behaviors/wl_test.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)
 set(TEST_BEHAVIOR_FILES src/behaviors/Scheduler.cpp src/behaviors/WH_Robot.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 926c456..24a4ae8 100644
--- a/scout/libscout/src/BehaviorList.cpp
+++ b/scout/libscout/src/BehaviorList.cpp
@@ -8,7 +8,7 @@ BehaviorList::BehaviorList(std::string scoutname)
   behavior_list.push_back((Behavior*)new navigationMap(scoutname));
   behavior_list.push_back((Behavior*)new Scheduler(scoutname));
   behavior_list.push_back((Behavior*)new WH_Robot(scoutname));
-  behavior_list.push_back((Behavior*)new sim_line(scoutname));
+  behavior_list.push_back((Behavior*)new line_follow(scoutname));
   behavior_list.push_back((Behavior*)new wl_test(scoutname));
   return;
 }
diff --git a/scout/libscout/src/BehaviorList.h b/scout/libscout/src/BehaviorList.h
index 5a4c111..5ab49ed 100644
--- a/scout/libscout/src/BehaviorList.h
+++ b/scout/libscout/src/BehaviorList.h
@@ -2,7 +2,7 @@
 #define _BEHAVIOR_LIST_H_
 
 #include "Behavior.h"
-#include "behaviors/sim_line.h"
+#include "behaviors/line_follow.h"
 #include "behaviors/draw_cw_circle.h"
 #include "behaviors/draw_ccw_circle.h"
 #include "behaviors/Odometry.h"
diff --git a/scout/libscout/src/behaviors/lineDrive.cpp b/scout/libscout/src/behaviors/lineDrive.cpp
deleted file mode 100644
index 7824d84..0000000
--- a/scout/libscout/src/behaviors/lineDrive.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * @file line_drive.cpp
- *
- * Provides functions to implement line driving behavior.  This program extends
- * the behavior of the line-following program by following lines automatically
- * and implementing behaviors to deal with commands passed to line_drive.
- *
- * Specific implementation for the colony scout robots in a warehouse behaviour
- * setting.
- * 
- * @author James Carroll（キヤロル）
- * Cannabalized from Dan Jacobs code.
- * @date 2-6-2012
- */
-
-#include "line_drive.h"
-
-line_drive::line_drive(String scoutname): Behavior(scoutname, "line_drive")
-{
-  line_drive_init();
-  line_follow_init();
-  return;
-};
-
-/**
- * Starts the line following procedure. Must be called before other
- * line-following functions will work.  This function essentially resets the
- * state of line-following.
- */
-void line_drive_init()
-{
-	lineFollow_init();
-	for(int i=0; i<5; i++)state[i]=0;
-	stateCounter=0;
-	stateLength=0;
-	stopped=0;
-}
-
-
-/**
- * Follows a line and executes whatever command is next on the queue.
- * @param speed The speed with which to drive along the line.
- */
-int doDrive(int speed)
-{
-	if(stopped)
-	{
-		motors->set_sides(0,0,ABSOLUTE);
-		return NORMAL;
-	}
-
-
-	int code;
-	switch(state[0])
-	{	
-		case ISTRAIGHT:
-			code = lineFollow(speed);
-			if(code==INTERSECTION)
-			{
-				for(int i=0; i<4; i++) state[i]=state[i+1];
-				state[4]=0;
-				if(state[0]==0)stateCounter++;
-				break;
-			}
-			else if(code==NOBARCODE) return NORMAL;
-			return code;
-	
-	
-		case ILEFT:
-			code = turnLeft();
-			if(code==0)
-			{
-				state[0]=0;
-				stateCounter++;
-			}
-			break;
-	
-		case IRIGHT:
-	    	code = turnRight();
-	        if(code==0)
-	        {
-				state[0]=0;
-				stateCounter++;
-			}
-	        break;
-	
-	
-		default:
-			return LOST;
-
-	}
-
-	if(stateCounter>=stateLength)
-	{
-		stateCounter=stateLength=0;
-		return FINISHED;
-	}
-	return NORMAL;
-}
-
-
-/** Starts the line-drive process if paused. */
-void start(void){
-	stopped=0;
-}
-
-/** Pauses the line-drive process. Default is started. */
-void stop(void){
-	stopped=1;
-}
-
-
-
-/**
- * Executes an intersection turn where the intersection type is specified by the
- * parameters. 
- * @param type A valid defined intersection type
- * @param dir The direction to turn at the intersection
- */
-int turn(int type, int dir)
-{
-	if(stateLength!=0)
-		return ERROR;
-
-	//turns that don't depend on what kind of road your on
-	if(dir==ISTRAIGHT)
-	{
-		stateLength++;
-		state[1]=ISTRAIGHT;
-		return NORMAL;
-	}
-	if(dir==IUTURN)
-	{
-		stateLength+=2;
-		state[1]=state[2]=ILEFT;
-		return NORMAL;
-	}
-
-	if(type==ON_ROAD)
-	{
-		if(dir==IRIGHT){
-			stateLength++;
-			state[1] = IRIGHT;
-			return NORMAL;
-		}
-		if(dir==ILEFT){
-			stateLength += 2;
-			state[1] = ILEFT;
-			state[2] = ISTRAIGHT;
-			return NORMAL
-		}
-	}
-	if(type==OFF_ROAD)
-	{
-		if(dir==IRIGHT){
-			stateLength++;
-			state[1]=IRIGHT;
-			return NORMAL;
-		}
-		if(dir==ILEFT){
-			stateLength+=2;
-			state[1]=ISTRAIGHT;
-			state[2]=ILEFT;
-		}
-	}
-
-	//Should never get here
-	return ERROR;
-}
-
diff --git a/scout/libscout/src/behaviors/lineDrive.h b/scout/libscout/src/behaviors/lineDrive.h
deleted file mode 100644
index a0871c7..0000000
--- a/scout/libscout/src/behaviors/lineDrive.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _LINE_DRIVE_H_
-#define _LINE_DRIVE_H_
-
-#include "../Behavior.h"
-#include "lineFollow.h"
-
-/*
- * Defines whether your making a turn from the main two-way road
- * or from a one-way sub road.
-*/
-#define ON_ROAD		0
-#define OFF_ROAD	0
-
-/*
- * The type of turn you are making from the road you are on.
-*/
-#define ISTRAIGHT	0
-#define ILEFT		1
-#define IRIGHT		2
-#define IUTURN		3
-
-#define NORMAL		-1
-#define FINISHED	-2
-#define LOST		-3
-#define ERROR		-4
-
-class line_drive : Behavior{
-	line_drive(String scoutname);
-	run();
-
-	void line_drive_init(void);
-
-	int doDrive(int speed);
-
-	void start(void);
-	void stop(void);
-
-
-	int turn(int type, iint dir);
-
-  private:
-  int state[5];       //! Stores a queue of sub-commands to be executed
-  int stateCounter;
-  int stateLength;
-
-  //! Whether line_drive is currently paused. Set to 0 on initialization.
-  int stopped=1;
-
-};
-
-#endif
diff --git a/scout/libscout/src/behaviors/line_follow.cpp b/scout/libscout/src/behaviors/line_follow.cpp
index 49f1537..1a3072a 100644
--- a/scout/libscout/src/behaviors/line_follow.cpp
+++ b/scout/libscout/src/behaviors/line_follow.cpp
@@ -1,281 +1,109 @@
 /**
- * @file line_follow.cpp
- * @defgroup lineFollwing Line Following
- *
- * Takes care of following a line. Running this program is done by calling the
- * init() function and then the line_follow(speed) command.  However, direct use
- * of this class is discouraged as its behavior is used by lineDrive.cpp, which
- * extends this class to provide behavior functionality.
- *
- * @author Dan Jacobs and the Colony Project
- * @date 11-1-2010
+ * Copyright (c) 2011 Colony Project
+ * 
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 #include "line_follow.h"
 
-//! Anything lower than this value is white
-int GREY_THRESHOLD = 300;
-//! Anything higher than this value is black
-int BLACK_THRESHOLD = 750;
+using namespace std;
 
-int countHi = 0;
-int countLo = 0;
-int maxAvg, avg;
+static int motor_l;
+static int motor_r;
 
-int duration[2] = {0};
-int lastColor[2] = {0};
-char isReset[2] = {1};
-int lastReadings[2][ NUM_READINGS ] = {{0}};
-int lastReadingsPtr[2] = {0};
-int numLast[2][4] = { {0, 0, 0, NUM_READINGS}, {0, 0, 0, NUM_READINGS} };
-int bitColor[2] = {0};
-
-int turnDistance=0;
-//! Counts the number of full line readings before we determine an intersection
-int intersectionFilter=0;
+void line_follow::follow_line()
+{
+    while(!linesensor->fullline())
+    {
+        double line_loc = linesensor->readline();
 
-//! Keeps track of where the encoder of one motor started, for use in turns.
-int encoderStart = -1;
-int encoderReset = 0;   // 0 if encoderStart has no value set
+        cout << "line_loc: " << line_loc << endl;
 
-int min(int x, int y){return x>y ? y : x;}
-int max(int x, int y){return x<y ? y : x;}
+        motor_l = -MOTOR_BASE + SCALE * line_loc;
+        motor_r = -MOTOR_BASE - SCALE * line_loc;
 
+        motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
+    }
+    halt();
+}
 
-void line_follow::init()
+void line_follow::turn_left()
 {
-  int i, j, curReading;
-  int lowGrey = 1000, highGrey = 0, lowBlack = 1000,
-      highBlack = 0;
+  bool first = true;
+  do
+  {
+    motor_l = -MOTOR_BASE;
+    motor_r = MOTOR_BASE/8;
 
-  analog_init(0);
-  encoders_init();
-  lost = 0;
-  intersectionFilter=0;
+    motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
 
-  for(i=0; i<2; i++)
-  {
-    for(j=0; j<NUM_READINGS; j++)
+    double line_loc = linesensor->readline();
+    cout << "line_loc: " << line_loc << endl;
+    if(first)
     {
-      lastReadings[i][j] = BAD_READING;
+        loop_rate->sleep();
+        loop_rate->sleep();
+        loop_rate->sleep();
+        first = false;
     }
-    isReset[i] = 1;
-  }
-
-  // Calibrate thresholds
-  orb_set_color(YELLOW);
-  delay_ms(2000);
-
-  orb_set_color(BLUE);
-
-  for(i=0; i<100; i++)
-  {
-    curReading = read_line(LEFT_SENSOR + 6);
-    if(curReading < lowGrey)
-      lowGrey = curReading;
-    if(curReading > highGrey)
-      highGrey = curReading;
-
-    delay_ms(20);
   }
-
-  orb_set_color(YELLOW);
-  delay_ms(2000);
-
-  orb_set_color(GREEN);
-
-  for(i=0; i<100; i++)
-  {
-    curReading = read_line(LEFT_SENSOR + 6);
-    if(curReading < lowBlack)
-      lowBlack = curReading;
-    if(curReading > highBlack)
-      highBlack = curReading;
-
-    delay_ms(20);
-  }
-
-  orbs_set(0,0,0,0,0,0);
-
-  GREY_THRESHOLD = lowGrey / 2;
-  BLACK_THRESHOLD = (highGrey + lowBlack) / 2;
-
-  usb_puts("Grey: ");
-  usb_puti(lowGrey);
-  usb_puts(", ");
-  usb_puti(highGrey);
-  usb_puts("\nBlack: ");
-  usb_puti(lowBlack);
-  usb_puts(", ");
-  usb_puti(highBlack);
-  usb_puts("\nThresholds: ");
-  usb_puti(GREY_THRESHOLD);
-  usb_puts(", ");
-  usb_puti(BLACK_THRESHOLD);
-  usb_puts("\n\n");
-
-  delay_ms(1500);
+  while(linesensor->readline());
 }
 
-
-/** 
- * Follows a line at the given speed.
- * @param speed The speed with which to follow the line.
- */
-int line_follow::follow_line(int speed)
+void line_follow::halt()
 {
-	int colors[5];
-	int position;
-	
-
-	updateLine(colors);
-	position = lineLocate(colors); 	
-	
-	//not on line
-	if(position == NOLINE)
-	{
-		if(lost++ > 20)
-		{
-			orb2_set_color(GREEN);
-			motors_off();
-			return LINELOST;
-		}
-	}
-	else if(position == FULL_LINE)
-	{
-		if(intersectionFilter++ > 4)
-		{
-			orb2_set_color(RED);
-			barCodePosition[0]=0;
-            barCodePosition[1]=0;
-			disableBarCode=50;
-		}
-	}
-	//on line
-	else
-	{
-		position*=30;
-		orb2_set_color(ORB_OFF);
-		motorLeft(min(speed+position, 255));
-		motorRight(min(speed-position, 255));
-		lost=0;
-		intersectionFilter=0;
-	}
+    motors->set_sides(0, 0, MOTOR_ABSOLUTE);
 }
 
-
-/**
- * Turns left at a cross of two lines.  Assumes that we are at lines in a cross
- * pattern, and turns until it sets straight on the new line.
- * @return 0 if turn finishes otherwise return 1
- */
-int line_follow::turnLeft()
+void line_follow::turn_right()
 {
-        motors->set_sides(-20, 20, MOTOR_ABSOLUTE);
-		
-        if(!encoderReset)
-        {
-            encoderStart = encoder_get_x(RIGHT);
-            encoderReset = 1;
-        }
-
-        if(encoder_get_x(RIGHT) < encoderStart)
-        {
-            encoderStart = 0;
-            motors->set_sides(0, 0, MOTOR_ABSOLUTE);
-            delay_ms(2000);
-        }
-
-        if(encoder_get_x(RIGHT) - encoderStart > 300)
-        {
-            encoderReset = 0;
-            return 0;
-        }
-        return 1;
-}
-
-
-
-/**
- * Turns right at a cross of two lines.  Assumes that we are at lines in a cross
- * pattern, and turns until it sets straight on the new line.
- * @return 0 if the turn finishes otherwise return 1
- */
-int line_follow::turnRight()
-{
-  /// Set motors using new motors functions
-  motors->set_sides(20, -20, MOTOR_ABSOLUTE);
+  bool first = true;
+  do
+  {
+    motor_l = MOTOR_BASE/8;
+    motor_r = -MOTOR_BASE;
 
-  int colors[5];
-  updateLine(colors);
-  int position = lineLocate(colors);
-  if(position>2 || position<-2)
-    turnDistance++;
+    motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
 
-  if(turnDistance>1) 
-  {
-    if(position<3 && position>-3)
+    double line_loc = linesensor->readline();
+    cout << "line_loc: " << line_loc << endl;
+    if(first)
     {
-      turnDistance = 0;
-      return 0;
+        loop_rate->sleep();
+        loop_rate->sleep();
+        loop_rate->sleep();
+        first = false;
     }
   }
-  return 1;
-}
-
-
-void line_follow::updateLine(int* values)
-{	
-	for(int i = 0; i<5; i++)
-		values[i] = (read_line(4-i) < LINE_COLOR ? LWHITE : LBLACK);
-}
-
-
-int line_follow::lineLocate(int* colors)
-{
-	int i;
-	int wsum = 0;
-	int count=0;
-
-	for(i = 0; i<5; i++)
-	{
-		count += colors[i]/2;
-		wsum += (i)*colors[i];
-	}
-	if(count==0)
-		return NOLINE;	
-	if(count==5)
-		return FULL_LINE;
-	return (wsum/count)-4; /// Subtract 4 to center the index around the center.
-}
-
-void line_follow::motorLeft(int speed)
-{
-	int tempspeed = 0;
-	if ((speed-=127)>=0)
-	{	
-		tempspeed = 160+speed*95/128;
-		motors->set(MOTOR_LEFT, tempspeed, MOTOR_ABSOLUTE);
-	}
-	else
-	{
-		tempspeed = 160+speed*95/128;
-		motors->set(MOTOR_LEFT, -tempspeed, MOTOR_ABSOLUTE);
-	}
+  while(linesensor->readline());
 }
 
-void line_follow::motorRight(int speed)
+void line_follow::run()
 {
-	int tempspeed = 0;
-	if ((speed-=127)>=0)
-	{	
-		tempspeed = 160+speed*95/128;
-		motors->set(MOTOR_RIGHT, tempspeed, MOTOR_ABSOLUTE);
-	}
-	else
-	{
-		tempspeed = 160+speed*95/128;
-		motors->set(MOTOR_RIGHT, -tempspeed, MOTOR_ABSOLUTE);
-	}
+  follow_line();
+  turn_right();
+  follow_line();
+  turn_left();
+  follow_line();
+  turn_right();
+  follow_line();
 }
-	
diff --git a/scout/libscout/src/behaviors/line_follow.h b/scout/libscout/src/behaviors/line_follow.h
index e501e89..56f84f8 100644
--- a/scout/libscout/src/behaviors/line_follow.h
+++ b/scout/libscout/src/behaviors/line_follow.h
@@ -1,107 +1,49 @@
+/**
+ * Copyright (c) 2011 Colony Project
+ * 
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
 
 #ifndef _LINE_FOLLOW_H_
 #define _LINE_FOLLOW_H_
 
 #include "../Behavior.h"
 
-#define LWHITE			0
-#define LGREY			1
-#define LBLACK	 		2
-#define BAD_READING     3
-#define CENTER			3
-#define LINELOST		-1
-
-#define INTERSECTION 	-25
-
-#define NOLINE			-50
-#define FULL_LINE 		-51
-
-#define NUM_READINGS 20
-
-#define LEFT_SENSOR     1
-#define RIGHT_SENSOR    0
-
-/**
- * Helps with debugging.
- * 0 - no debug output.
- * 1 - print out buckets
- * 2 - print out line sensor readings
- */
-#define DBG_LINEFOLLOW 2
-
+#define MOTOR_BASE 50
+#define SCALE 20
 
-//! A simple function to return the minimum of two integers.
-int min(int x, int y);
-//! A simple function to return the maximum of two integers.
-int max(int x, int y);
-
-
-class line_follow 
+class line_follow : Behavior
 {
-	public:
-    /** Actually executes the behavior. */
-		void init();
-
-    /**	line_follow
-     *	Must call line_follow_init first
-     *	Must be called inside a loop
-     */
-    int follow_line(int speed);
-
-    /**	turnLeft turnRight
-     *	Must be called inside a loop
-     *	returns 0 when complete
-     */
-    int turnLeft(void);
-    int turnRight(void);
-
-    /**
-     * @brief Updates the values stored in the array to white or black based on
-     * current sensor readings.
-     *
-     * @param values The array of five integers to be updated. 
-     */
-    void updateLine(int* values); 
+    public:
+        line_follow(std::string scoutname) : Behavior(scoutname, "line_follow") {};
 
-    /**
-     * @brief Returns an index of the middle of the line based on line readings.
-     *
-     * Two special return values are possible:
-     *   NOLINE if none of the sensors holds a black value, and
-     *   FULL_LINE if all of the sensors see black.
-     *
-     * Otherwise, returns a value from -4 (farthest left) to 4 (farthest right), with
-     * 0 the line being centered in the middle.
-     *
-     * @param colors The array of 5 readings from the line sensor.  Must be either
-     *    LWHITE or LBLACK.
-     * @return Either a special value or an index from -4 to 4.
-     *
-     */
-    int lineLocate(int* colors);
-
-    /** @todo Alex: I hate these functions, but I'm keeping them so code will still work. But we should delete them sometime. */
-
-    /**	motorLeft
-     *	Commands the left motor
-     *	Cannot be used to stop
-     *	0-126 are backward
-     *	127-255 are forward
-     */
-    void motorLeft(int speed);
-
-    /**	motorRight
-     *	Commands the right motor
-     *	Cannot be used to stop
-     *	0-126 are backward
-     *	127-255 are forward
-     */
-    void motorRight(int speed);
+        /** Actually executes the behavior. */
+        void run();
 
     private:
-    /**	lost
-     *	Internal counter to detect if the line was lost
-     */
-    int lost;
+        void turn_left();
+        void turn_right();
+        void follow_line();
+        void halt();
 };
+
 #endif
diff --git a/scout/libscout/src/behaviors/sim_line.cpp b/scout/libscout/src/behaviors/sim_line.cpp
deleted file mode 100644
index 45dff5a..0000000
--- a/scout/libscout/src/behaviors/sim_line.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright (c) 2011 Colony Project
- * 
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "sim_line.h"
-
-using namespace std;
-
-static int motor_l;
-static int motor_r;
-
-void sim_line::follow_line()
-{
-    while(!linesensor->fullline())
-    {
-        double line_loc = linesensor->readline();
-
-        cout << "line_loc: " << line_loc << endl;
-
-        motor_l = -MOTOR_BASE + SCALE * line_loc;
-        motor_r = -MOTOR_BASE - SCALE * line_loc;
-
-        motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
-    }
-    halt();
-}
-
-void sim_line::turn_left()
-{
-  bool first = true;
-  do
-  {
-    motor_l = -MOTOR_BASE;
-    motor_r = MOTOR_BASE/8;
-
-    motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
-
-    double line_loc = linesensor->readline();
-    cout << "line_loc: " << line_loc << endl;
-    if(first)
-    {
-        loop_rate->sleep();
-        loop_rate->sleep();
-        loop_rate->sleep();
-        first = false;
-    }
-  }
-  while(linesensor->readline());
-}
-
-void sim_line::halt()
-{
-    motors->set_sides(0, 0, MOTOR_ABSOLUTE);
-}
-
-void sim_line::turn_right()
-{
-  bool first = true;
-  do
-  {
-    motor_l = MOTOR_BASE/8;
-    motor_r = -MOTOR_BASE;
-
-    motors->set_sides(motor_l, motor_r, MOTOR_ABSOLUTE);
-
-    double line_loc = linesensor->readline();
-    cout << "line_loc: " << line_loc << endl;
-    if(first)
-    {
-        loop_rate->sleep();
-        loop_rate->sleep();
-        loop_rate->sleep();
-        first = false;
-    }
-  }
-  while(linesensor->readline());
-}
-
-void sim_line::run()
-{
-  follow_line();
-  turn_right();
-  follow_line();
-  turn_left();
-  follow_line();
-  turn_right();
-  follow_line();
-}
diff --git a/scout/libscout/src/behaviors/sim_line.h b/scout/libscout/src/behaviors/sim_line.h
deleted file mode 100644
index 1e9e7b3..0000000
--- a/scout/libscout/src/behaviors/sim_line.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (c) 2011 Colony Project
- * 
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- * 
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _SIM_LINE_H_
-#define _SIM_LINE_H_
-
-#include "../Behavior.h"
-
-#define MOTOR_BASE 50
-#define SCALE 20
-
-class sim_line : Behavior
-{
-    public:
-        sim_line(std::string scoutname) : Behavior(scoutname, "sim_line") {};
-
-        /** Actually executes the behavior. */
-        void run();
-
-    private:
-        void turn_left();
-        void turn_right();
-        void follow_line();
-        void halt();
-};
-
-#endif
