commit d140fd71ddd19ef38a0124cbbea1165874a5474d
Author: Yuyang <yuyang@yuyang-VirtualBox.(none)>
Date:   Sun Oct 28 16:37:37 2012 -0400

    Added Sensors class that abstracts away sensors from behaviors. Stops creating
    duplicated sensors for each scout.

diff --git a/scout/libscout/CMakeLists.txt b/scout/libscout/CMakeLists.txt
index d2230e2..0aa453f 100644
--- a/scout/libscout/CMakeLists.txt
+++ b/scout/libscout/CMakeLists.txt
@@ -29,7 +29,7 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
 #rosbuild_add_executable(example examples/example.cpp)
 #target_link_libraries(example ${PROJECT_NAME})
 
-set(MAIN_FILES src/Behavior.cpp src/BehaviorList.cpp src/BehaviorProcess.cpp)
+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)
 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)
diff --git a/scout/libscout/src/Behavior.cpp b/scout/libscout/src/Behavior.cpp
index f76872c..34594a5 100644
--- a/scout/libscout/src/Behavior.cpp
+++ b/scout/libscout/src/Behavior.cpp
@@ -48,19 +48,12 @@ using namespace std;
  * @param scoutname If nonempty, specifies which scout in the simulator
  *                  will be controlled by this behavior.
  */
-Behavior::Behavior(string scoutname, string my_name)
+Behavior::Behavior(string scoutname, string my_name, Sensors * sensors)
 {
-    name = my_name;
-
-    motors = new MotorControl(node, scoutname);
-    buttons = new ButtonControl(node, scoutname);
-    sonar = new SonarControl(node, scoutname);
-    //cliffsensor = new CliffsensorControl(node, scoutname);
-    encoders = new EncodersControl(node, scoutname);
-    linesensor = new LinesensorControl(node, scoutname);
-    wl_sender = new WirelessSender(node);
-    wl_receiver = new WirelessReceiver(node);
 
+    name = my_name;
+    sensors->init(&motors, &buttons, &sonar, &encoders, &linesensor,
+                        &wl_sender, &wl_receiver);
     loop_rate = new ros::Rate(10);
 }
 
diff --git a/scout/libscout/src/Behavior.h b/scout/libscout/src/Behavior.h
index 8dd983f..f8a3ca4 100644
--- a/scout/libscout/src/Behavior.h
+++ b/scout/libscout/src/Behavior.h
@@ -50,6 +50,7 @@
 #include "WirelessSender.h"
 #include "WirelessReceiver.h"
 #include "constants.h"
+#include "Sensors.h"
 
 typedef ros::Time Time;
 typedef ros::Duration Duration;
@@ -58,14 +59,16 @@ class Behavior
 {
     public:
         // Initializes ROS for behavior
-        Behavior(std::string scoutname, std::string name);
+        // name stands for behavior name
+        Behavior(std::string scoutname, std::string name,
+                 Sensors * sensor);
 
         /// Extended by subclasses to actually run the behavior.
         virtual void run() = 0;
 
         // Name of behaviour
         std::string name;
-
+        
     protected:
         ros::NodeHandle node;
 
diff --git a/scout/libscout/src/BehaviorList.cpp b/scout/libscout/src/BehaviorList.cpp
index 24a4ae8..46371a8 100644
--- a/scout/libscout/src/BehaviorList.cpp
+++ b/scout/libscout/src/BehaviorList.cpp
@@ -1,15 +1,16 @@
 #include "BehaviorList.h"
 
-BehaviorList::BehaviorList(std::string scoutname)
+
+BehaviorList::BehaviorList(std::string scoutname, Sensors * sensor)
 {
-  behavior_list.push_back((Behavior*)new draw_cw_circle(scoutname));
-  behavior_list.push_back((Behavior*)new draw_ccw_circle(scoutname));
-  behavior_list.push_back((Behavior*)new Odometry(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 line_follow(scoutname));
-  behavior_list.push_back((Behavior*)new wl_test(scoutname));
+  behavior_list.push_back((Behavior*)new draw_cw_circle(scoutname,sensor));
+  behavior_list.push_back((Behavior*)new draw_ccw_circle(scoutname, sensor));
+  behavior_list.push_back((Behavior*)new Odometry(scoutname, sensor));
+  behavior_list.push_back((Behavior*)new navigationMap(scoutname, sensor));
+  behavior_list.push_back((Behavior*)new Scheduler(scoutname, 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));
   return;
 }
 
diff --git a/scout/libscout/src/BehaviorList.h b/scout/libscout/src/BehaviorList.h
index 5ab49ed..65c066e 100644
--- a/scout/libscout/src/BehaviorList.h
+++ b/scout/libscout/src/BehaviorList.h
@@ -10,14 +10,14 @@
 #include "behaviors/Scheduler.h"
 #include "behaviors/WH_Robot.h"
 #include "behaviors/wl_test.h"
-
+#include "Sensors.h"
 class BehaviorList
 {
   public:
   std::vector<Behavior*> behavior_list;
 
   //Constructor. Initializes behavior_list
-  BehaviorList(std::string scoutname);
+  BehaviorList(std::string scoutname, Sensors* sensor);
   //Destructor. Frees behavior_list;
   ~BehaviorList();
 };
diff --git a/scout/libscout/src/BehaviorProcess.cpp b/scout/libscout/src/BehaviorProcess.cpp
index 8344aff..4abe992 100644
--- a/scout/libscout/src/BehaviorProcess.cpp
+++ b/scout/libscout/src/BehaviorProcess.cpp
@@ -1,3 +1,4 @@
+
 /**
  * Copyright (c) 2011 Colony Project
  * 
@@ -34,6 +35,8 @@
  */
 
 #include "BehaviorProcess.h"
+#include "Sensors.h"
+#include "assert.h"
 
 int main (int argc, char **argv)
 {
@@ -56,10 +59,10 @@ int main (int argc, char **argv)
         behavior_num = atoi(argv[2]);
 
         ros::init(argc, argv, scoutname + "_behavior");
-
-        BehaviorList* list = new BehaviorList(scoutname);
+        // one Sensor instance per-class
+        Sensors* sensors = new Sensors(scoutname);
+        BehaviorList* list = new BehaviorList(scoutname, sensors);
         vector<Behavior*> behavior_list = list->behavior_list;
-
         if (behavior_num < (int)behavior_list.size())
         {
             (behavior_list[behavior_num])->run();
diff --git a/scout/libscout/src/MotorControl.h b/scout/libscout/src/MotorControl.h
index b344000..48af68d 100644
--- a/scout/libscout/src/MotorControl.h
+++ b/scout/libscout/src/MotorControl.h
@@ -65,7 +65,7 @@
 #define MOTOR_LEFT_SPIN MOTOR_LEFT_REV | MOTOR_RIGHT
 #define MOTOR_RIGHT_SPIN MOTOR_LEFT | MOTOR_RIGHT_REV
 
-#define MAXSPEED 100
+#define MAXSPEED 255
 #define MOTOR_PERCENT 'p'
 #define MOTOR_MMS 'm'
 #define MOTOR_CMS 'c'
diff --git a/scout/libscout/src/Sensors.cpp b/scout/libscout/src/Sensors.cpp
new file mode 100644
index 0000000..5dbd00e
--- /dev/null
+++ b/scout/libscout/src/Sensors.cpp
@@ -0,0 +1,68 @@
+/**
+ * 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.
+ */
+
+/**
+ * @file Behavior.cpp
+ * @brief Contains basic functions for the structure of all behaviors.
+ * 
+ * Contains function implementations needed for all behavior.
+ *
+ * @author Colony Project, CMU Robotics Club
+ * @author Priyanka Deo
+ * @author Alex Zirbel
+ **/
+
+#include "Sensors.h"
+
+using namespace std;
+
+Sensors::Sensors(string scoutname)
+{
+    name = scoutname;
+    motors = new MotorControl(node,scoutname);
+    buttons = new ButtonControl(node, scoutname);
+    sonar = new SonarControl(node, scoutname);
+    //cliffsensor = new CliffsensorControl(node, scoutname);
+    encoders = new EncodersControl(node, scoutname);
+    linesensor = new LinesensorControl(node, scoutname);
+    wl_sender = new WirelessSender(node);
+}
+
+// b_stuff stand for behavior control class
+void Sensors::init(MotorControl** b_motors, ButtonControl ** b_buttons,
+                  SonarControl ** b_sonar, EncodersControl ** b_encoders,
+                  LinesensorControl ** b_linesensor,
+                  WirelessSender ** b_wl_sender,
+                  WirelessReceiver ** b_wl_receiver)
+{
+    //(MotorControl *)(* b_motors) = motors;
+    *b_motors = motors;
+    *b_buttons = buttons;
+    *b_sonar = sonar;
+    *b_encoders = encoders;
+    *b_linesensor = linesensor;
+    *b_wl_sender = wl_sender;
+    *b_wl_receiver = new WirelessReceiver(node);
+}
diff --git a/scout/libscout/src/Sensors.h b/scout/libscout/src/Sensors.h
new file mode 100644
index 0000000..f66f278
--- /dev/null
+++ b/scout/libscout/src/Sensors.h
@@ -0,0 +1,78 @@
+/**
+ * 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.
+ */
+
+/**
+ * @file Behavior.h
+ * @brief Contains declarations for the structure of all behaviours.
+ * 
+ * Contains functions and definitions for a generic behavior.
+ *
+ * @author Colony Project, CMU Robotics Club
+ * @author Priyanka Deo
+ * @author Alex Zirbel
+ **/
+
+#ifndef _SENSORS_H_
+#define _SENSORS_H_
+
+#include <ros/ros.h>
+#include <std_msgs/String.h>
+
+#include "MotorControl.h"
+#include "HeadlightControl.h"
+#include "ButtonControl.h"
+#include "SonarControl.h"
+//#include "CliffsensorControl.h"
+#include "EncodersControl.h"
+#include "LinesensorControl.h"
+#include "WirelessSender.h"
+#include "WirelessReceiver.h"
+
+class Sensors
+{
+    public:
+        Sensors(std::string scoutname);
+        // b_stuff stand for behavior control class
+        void init(MotorControl ** b_motors, ButtonControl ** b_buttons,
+                  SonarControl ** b_sonar, EncodersControl ** b_encoders,
+                  LinesensorControl ** b_linesensor,
+                  WirelessSender ** b_wl_sender,
+                  WirelessReceiver ** b_wl_receiver);
+        std::string name;
+    private:
+        ros::NodeHandle node;
+        MotorControl * motors;
+        ButtonControl * buttons;
+        SonarControl * sonar;
+        //CliffsensorControl * cliffsensor;
+        EncodersControl * encoders;
+        LinesensorControl * linesensor;
+        WirelessSender * wl_sender;
+        WirelessReceiver * wl_receiver;
+        
+};
+
+
+#endif
diff --git a/scout/libscout/src/behaviors/Odometry.cpp b/scout/libscout/src/behaviors/Odometry.cpp
index ed0a766..d9a1b46 100644
--- a/scout/libscout/src/behaviors/Odometry.cpp
+++ b/scout/libscout/src/behaviors/Odometry.cpp
@@ -4,7 +4,8 @@
 using namespace std;
 
 /** Set up the odometry node and prepare communcations over ROS */
-Odometry::Odometry(string scoutname):Behavior(scoutname, "odometry")
+Odometry::Odometry(string scoutname, Sensors* sensors):Behavior(scoutname, 
+                                                "odometry", sensors)
 {
   scout_pos = new pos;
 }
diff --git a/scout/libscout/src/behaviors/Odometry.h b/scout/libscout/src/behaviors/Odometry.h
index b8a84e4..d48cf77 100644
--- a/scout/libscout/src/behaviors/Odometry.h
+++ b/scout/libscout/src/behaviors/Odometry.h
@@ -2,6 +2,7 @@
 #define _ODOMETRY_H_
 
 #include "../Behavior.h"
+#include "../Sensors.h"
 
 
 #define WHEEL_RADIUS  5
@@ -21,7 +22,7 @@ class Odometry : Behavior{
   public:
 
   /** Set up the odometry node and prepare communcations over ROS */
-  Odometry(std::string scoutname);
+  Odometry(std::string scoutname, Sensors* sensors);
 
   /** Query encoders and estimate position based on encoder reading */
   void get_position();
diff --git a/scout/libscout/src/behaviors/Scheduler.cpp b/scout/libscout/src/behaviors/Scheduler.cpp
index 4aac077..443b1b1 100644
--- a/scout/libscout/src/behaviors/Scheduler.cpp
+++ b/scout/libscout/src/behaviors/Scheduler.cpp
@@ -4,7 +4,8 @@
 using namespace std;
 
 /** @Brief: Initialize data structures for the scheduler. */
-Scheduler::Scheduler(std::string scoutname):Behavior(scoutname, "Scheduler")
+Scheduler::Scheduler(std::string scoutname, Sensors* sensors):
+            Behavior(scoutname, "Scheduler", sensors)
 {
   unassignedOrders = new PQWrapper(NUM_TASKS);
 
diff --git a/scout/libscout/src/behaviors/Scheduler.h b/scout/libscout/src/behaviors/Scheduler.h
index 4a73e74..5e2bf28 100644
--- a/scout/libscout/src/behaviors/Scheduler.h
+++ b/scout/libscout/src/behaviors/Scheduler.h
@@ -30,7 +30,7 @@ class Scheduler : Behavior {
   void msg_callback(const std_msgs::String::ConstPtr& msg);
 
 public:
-  Scheduler(std::string scoutname);
+  Scheduler(std::string scoutname, Sensors* sensors);
 	~Scheduler();
 	
 	void get_task(int robot);
diff --git a/scout/libscout/src/behaviors/WH_Robot.cpp b/scout/libscout/src/behaviors/WH_Robot.cpp
index 71adaff..17111ec 100644
--- a/scout/libscout/src/behaviors/WH_Robot.cpp
+++ b/scout/libscout/src/behaviors/WH_Robot.cpp
@@ -2,9 +2,10 @@
 #include "../helper_classes/Order.h"
 
 /** @Brief: warehouse robot constructor **/
-WH_Robot::WH_Robot(std::string scoutname):line_follow(scoutname) 
+WH_Robot::WH_Robot(std::string scoutname, Sensors* sensors):
+            line_follow(scoutname, sensors) 
 {
-  nav_map = new navigationMap(scoutname);
+  nav_map = new navigationMap(scoutname, sensors);
   curr_task = DEFAULT_TASK;
   name = scoutname;
   reg_failed = 1;
diff --git a/scout/libscout/src/behaviors/WH_Robot.h b/scout/libscout/src/behaviors/WH_Robot.h
index b15cb0a..f1427fc 100644
--- a/scout/libscout/src/behaviors/WH_Robot.h
+++ b/scout/libscout/src/behaviors/WH_Robot.h
@@ -30,7 +30,7 @@ class WH_Robot : line_follow{
         void leave_home();
 
     public:
-        WH_Robot(std::string scoutname);
+        WH_Robot(std::string scoutname, Sensors* sensors);
         ~WH_Robot();
         void run();
 
diff --git a/scout/libscout/src/behaviors/draw_ccw_circle.cpp b/scout/libscout/src/behaviors/draw_ccw_circle.cpp
index ef5ae34..a2c46e3 100644
--- a/scout/libscout/src/behaviors/draw_ccw_circle.cpp
+++ b/scout/libscout/src/behaviors/draw_ccw_circle.cpp
@@ -29,7 +29,7 @@ void draw_ccw_circle::run()
 {
     while(ok())
     {
-        motors->set_sides(20, 80, MOTOR_ABSOLUTE);
+        motors->set_sides(80, 20, MOTOR_ABSOLUTE);
 
         spinOnce();
         loop_rate->sleep();
diff --git a/scout/libscout/src/behaviors/draw_ccw_circle.h b/scout/libscout/src/behaviors/draw_ccw_circle.h
index 212eef5..6acd44e 100644
--- a/scout/libscout/src/behaviors/draw_ccw_circle.h
+++ b/scout/libscout/src/behaviors/draw_ccw_circle.h
@@ -27,12 +27,13 @@
 #define _DRAW_CCW_CIRCLE_H_
 
 #include "../Behavior.h"
-
+#include "../Sensors.h"
 class draw_ccw_circle : Behavior
 {
     public:
         /// @todo Is this the best way to inherit the Behavior constructor?
-        draw_ccw_circle(std::string scoutname) : Behavior(scoutname, "draw_ccw_circle"){ };
+        draw_ccw_circle(std::string scoutname, Sensors* sensors) : 
+                        Behavior(scoutname, "draw_ccw_circle", sensors){ };
 
         /** Actually executes the behavior. */
         void run();
diff --git a/scout/libscout/src/behaviors/draw_cw_circle.cpp b/scout/libscout/src/behaviors/draw_cw_circle.cpp
index 1f2abad..5ab8602 100644
--- a/scout/libscout/src/behaviors/draw_cw_circle.cpp
+++ b/scout/libscout/src/behaviors/draw_cw_circle.cpp
@@ -29,7 +29,7 @@ void draw_cw_circle::run()
 {
     while(ok())
     {
-        motors->set_sides(80, 20, MOTOR_ABSOLUTE);
+        motors->set_sides(20, 80, MOTOR_ABSOLUTE);
 
         encoder_readings readings = encoders->query();
 
diff --git a/scout/libscout/src/behaviors/draw_cw_circle.h b/scout/libscout/src/behaviors/draw_cw_circle.h
index 0cef5cc..2d9667e 100644
--- a/scout/libscout/src/behaviors/draw_cw_circle.h
+++ b/scout/libscout/src/behaviors/draw_cw_circle.h
@@ -27,12 +27,14 @@
 #define _DRAW_CW_CIRCLE_H_
 
 #include "../Behavior.h"
+#include "../Sensors.h"
 
 class draw_cw_circle : Behavior
 {
     public:
         /// @todo Is this the best way to inherit the Behavior constructor?
-        draw_cw_circle(std::string scoutname) : Behavior(scoutname, "draw_cw_circle") {};
+        draw_cw_circle(std::string scoutname, Sensors* sensors) : 
+                Behavior(scoutname, "draw_cw_circle", sensors) {};
 
         /** Actually executes the behavior. */
         void run();
diff --git a/scout/libscout/src/behaviors/line_follow.h b/scout/libscout/src/behaviors/line_follow.h
index fae7ace..e08c8d6 100644
--- a/scout/libscout/src/behaviors/line_follow.h
+++ b/scout/libscout/src/behaviors/line_follow.h
@@ -27,6 +27,7 @@
 #define _LINE_FOLLOW_H_
 
 #include "../Behavior.h"
+#include "../Sensors.h"
 
 #define MOTOR_BASE 50
 #define SCALE 20
@@ -34,7 +35,8 @@
 class line_follow : public Behavior
 {
     public:
-        line_follow(std::string scoutname) : Behavior(scoutname, "line_follow") {};
+        line_follow(std::string scoutname, Sensors* sensors) : 
+                Behavior(scoutname, "line_follow", sensors) {};
 
         /** Actually executes the behavior. */
         void run();
diff --git a/scout/libscout/src/behaviors/navigationMap.cpp b/scout/libscout/src/behaviors/navigationMap.cpp
index a2bdc80..735f7eb 100644
--- a/scout/libscout/src/behaviors/navigationMap.cpp
+++ b/scout/libscout/src/behaviors/navigationMap.cpp
@@ -48,7 +48,8 @@ using namespace std;
  * The map itself is represented as a dynamic array of edge arrays
  * @param the string name of the scout
  */
-navigationMap::navigationMap(string scoutname) : Behavior(scoutname, "navigationMap")
+navigationMap::navigationMap(string scoutname, Sensors* sensors) : 
+            Behavior(scoutname, "navigationMap", sensors)
 {
   /** Initialize Map 
    *                     _____
diff --git a/scout/libscout/src/behaviors/navigationMap.h b/scout/libscout/src/behaviors/navigationMap.h
index b695b5f..2c306de 100644
--- a/scout/libscout/src/behaviors/navigationMap.h
+++ b/scout/libscout/src/behaviors/navigationMap.h
@@ -108,7 +108,7 @@ class navigationMap : Behavior
 
   public:
     /** Initializes the navigation map */
-    navigationMap(std::string scoutname);
+    navigationMap(std::string scoutname, Sensors* sensors);
     /** Goes through and frees all allocated memory */
     ~navigationMap();
 
diff --git a/scout/libscout/src/behaviors/trafficNavigation.h b/scout/libscout/src/behaviors/trafficNavigation.h
index d01d0cf..8d2a6db 100644
--- a/scout/libscout/src/behaviors/trafficNavigation.h
+++ b/scout/libscout/src/behaviors/trafficNavigation.h
@@ -136,7 +136,8 @@
 class trafficNavigation : Behavior
 {
     public:
-        trafficNavigation(std::string scoutname) : Behavior(scoutname, "traffic_nav") {};
+        trafficNavigation(std::string scoutname, Sensors* sensors) : 
+                Behavior(scoutname, "traffic_nav", sensors) {};
 
         void run();
 		int wirelessPacketHandle(int state);
diff --git a/scout/libscout/src/behaviors/wl_test.h b/scout/libscout/src/behaviors/wl_test.h
index 8df23ed..9dad1cb 100644
--- a/scout/libscout/src/behaviors/wl_test.h
+++ b/scout/libscout/src/behaviors/wl_test.h
@@ -27,11 +27,13 @@
 #define _WL_TEST_H_
 
 #include "../Behavior.h"
+#include "../Sensors.h"
 
 class wl_test : Behavior
 {
     public:
-        wl_test(std::string scoutname) : Behavior(scoutname, "wl_test"),
+        wl_test(std::string scoutname, Sensors* sensors) : 
+                Behavior(scoutname, "wl_test", sensors),
             no_response(true), scout_name(scoutname) {};
         /** Actually executes the behavior. */
         void data_callback(std::vector<uint8_t> data);
