commit cef78c70971ce70bb324f5ec6261c3fcae6f786a
Author: pdeo <pdeo@roboclub8.frc.ri.cmu.edu>
Date:   Fri Dec 30 00:27:38 2011 -0500

    Created Behavior class and a sample behavior using the class. Not tested.

diff --git a/scout/libscout/src/Behavior.cpp b/scout/libscout/src/Behavior.cpp
new file mode 100644
index 0000000..0cf0468
--- /dev/null
+++ b/scout/libscout/src/Behavior.cpp
@@ -0,0 +1,64 @@
+/**
+ * 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 behaviours.
+ * 
+ * Contains function implementations needed for all behavior.
+ *
+ * @author Colony Project, CMU Robotics Club
+ * @author Priyanka Deo
+ **/
+
+#include "Behavior.h"
+
+Behavior::init(int argc, char** argv)
+{
+    ros::init(argc, argv, "libscout");
+
+    motors(node);
+    //buttons(node);
+    //sonar(node);
+
+    ros::Rate loop_rate(10);
+}
+
+Behavior::ok()
+{
+    return ros::ok()
+}
+
+Behavior::spin()
+{
+    ros::spin();
+    return;
+}
+
+Behavior::spinOnce()
+{
+    ros::SpinOnce();
+    return;
+}
diff --git a/scout/libscout/src/Behavior.h b/scout/libscout/src/Behavior.h
new file mode 100644
index 0000000..89eb6e7
--- /dev/null
+++ b/scout/libscout/src/Behavior.h
@@ -0,0 +1,65 @@
+/**
+ * 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
+ **/
+
+#ifdef _BEHAVIOR_H_
+#define _BEHAVIOR_H_
+
+#include "libscout.h"
+
+class Behavior
+{
+    public:
+	ros::NodeHandle node;
+	ros::Rate loop_rate;
+	
+	//Declare all used library controls
+	MotorControl motors;
+	//ButtonControl buttons;
+	//SonarControl sonar;
+
+	//Initializes ROS for behavior
+	void init(int argc, char** argv);
+
+	//User implemented behavior
+	virtual int main(int argc, char** argv) = 0;
+
+	//Wrappers for ROS functions
+	bool ok();
+	void spin();
+	void spinOnce();
+
+};
+
+#endif
diff --git a/scout/libscout/src/priya_behavior.cpp b/scout/libscout/src/priya_behavior.cpp
new file mode 100644
index 0000000..2e9fd03
--- /dev/null
+++ b/scout/libscout/src/priya_behavior.cpp
@@ -0,0 +1,66 @@
+/**
+ * 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 priya_behavior.cpp
+ * @brief A simple robot behavior, smart-runaround style, that uses
+ * the behavior class
+ * 
+ * @author Colony Project, CMU Robotics Club
+ * @author Alex Zirbel
+ * @author Priyanka Deo
+ */
+
+#include "Behavior.h"
+
+/**
+ * @brief Priya_Behavior A simple robot behavior.
+ *
+ * Inherits Behavior class which contains all basic behavior
+ * functionality.
+ */
+class Priya_Behavior:Behavior
+{
+
+	/**
+	 * @brief Main. The main function for the behavior.
+	 *
+	 * Defined in Behavior class as a virtual. Must be
+	 * implemented in functional behaviors.
+	 */
+	int main(int argc, char **argv)
+	{
+		init(argc, argv);
+		while(ok())
+		{
+			motors.set_sides(20, 80, MOTOR_ABSOLUTE);
+
+			spinOnce();
+			loop_rate.sleep();
+		}
+
+		return 0;
+	}
+};
