commit c239584b0640e853b0f2e540d662bd7e354e83c7
Author: Priya <pdeo@Phlegethon.(none)>
Date:   Sat Jan 14 14:26:02 2012 -0500

    New behavior implementation that uses a list of behaviors to command multiple scouts with multiple behaviors.

diff --git a/scout/libscout/src/BehaviorList.cpp b/scout/libscout/src/BehaviorList.cpp
new file mode 100644
index 0000000..68996b5
--- /dev/null
+++ b/scout/libscout/src/BehaviorList.cpp
@@ -0,0 +1,16 @@
+#include "BehaviorList.h"
+
+//draw_cw_circle* behavior1 = new draw_cw_circle(scoutname)
+
+BehaviorList::BehaviorList(std::string scoutname)
+{
+  behavior_list.push_back((Behavior*)new draw_cw_circle(scoutname));
+  behavior_list.push_back((Behavior*)new draw_ccw_circle(scoutname));
+  return;
+}
+
+BehaviorList::~BehaviorList()
+{
+  while((int)behavior_list.size() != 0)
+    behavior_list.pop_back();
+}
diff --git a/scout/libscout/src/BehaviorList.h b/scout/libscout/src/BehaviorList.h
new file mode 100644
index 0000000..bbd2be7
--- /dev/null
+++ b/scout/libscout/src/BehaviorList.h
@@ -0,0 +1,22 @@
+#ifndef _BEHAVIOR_LIST_H_
+#define _BEHAVIOR_LIST_H_
+
+#include "Behavior.h"
+#include "behaviors/draw_cw_circle.h"
+#include "behaviors/draw_ccw_circle.h"
+
+#define NUM_BEHAVIORS 2
+#define NUM_SCOUTS 1
+
+class BehaviorList
+{
+  public:
+  std::vector<Behavior*> behavior_list;
+
+  //Constructor. Initializes behavior_list
+  BehaviorList(std::string scoutname);
+  //Destructor. Frees behavior_list;
+  ~BehaviorList();
+};
+
+#endif
diff --git a/scout/libscout/src/BehaviorProcess.cpp b/scout/libscout/src/BehaviorProcess.cpp
new file mode 100644
index 0000000..7483035
--- /dev/null
+++ b/scout/libscout/src/BehaviorProcess.cpp
@@ -0,0 +1,77 @@
+/**
+ * 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 A wrapper that executes PriyaBehavior as an executable.
+ *
+ * Should be auto-generated in the future.
+ * 
+ * @author Colony Project, CMU Robotics Club
+ * @author Alex Zirbel
+ */
+
+#include "BehaviorProcess.h"
+
+int main (int argc, char **argv)
+{
+    string scoutname = "";
+    int behavior_num;
+
+    // Running with no arguments only supports one scout. Check in case
+    // the user meant to specify a scout in the arguments.
+    if (argc != 3)
+    {
+        cout << "You have started this behavior in hardware mode." << endl
+             << "To start in software mode, use: " << argv[0]
+             << " <scoutname> <behavior#>" << endl;
+    }
+    else
+    {
+        // Use the provided scoutname for simulator messages
+        scoutname = argv[1];
+        behavior_num = atoi(argv[2]);
+
+        ros::init(argc, argv, "priya_behavior");
+
+        BehaviorList* list = new BehaviorList(scoutname);
+        vector<Behavior*> behavior_list = list->behavior_list;
+
+        if (behavior_num < (int)behavior_list.size())
+        {
+            (behavior_list[behavior_num])->run();
+        }
+        else
+        {
+            cout << "There is no behavior number" << behavior_num
+              << ". There are only " << (int)behavior_list.size() << "behaviors."
+              << endl;
+        }
+
+        delete list;
+    }
+
+    return 0;
+}
diff --git a/scout/libscout/src/BehaviorProcess.h b/scout/libscout/src/BehaviorProcess.h
new file mode 100644
index 0000000..51f6a51
--- /dev/null
+++ b/scout/libscout/src/BehaviorProcess.h
@@ -0,0 +1,11 @@
+#ifndef _BEHAVIOR_PROCESS_
+#define _BEHAVIOR_PROCESS_
+
+#include <ros/ros.h>
+#include "BehaviorList.h"
+
+using namespace std;
+
+  int main(int argc, char** argv);
+
+#endif
diff --git a/scout/libscout/src/behaviors/draw_ccw_circle.cpp b/scout/libscout/src/behaviors/draw_ccw_circle.cpp
new file mode 100644
index 0000000..a2c46e3
--- /dev/null
+++ b/scout/libscout/src/behaviors/draw_ccw_circle.cpp
@@ -0,0 +1,37 @@
+/**
+ * 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 "draw_ccw_circle.h"
+
+void draw_ccw_circle::run()
+{
+    while(ok())
+    {
+        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
new file mode 100644
index 0000000..51c0b34
--- /dev/null
+++ b/scout/libscout/src/behaviors/draw_ccw_circle.h
@@ -0,0 +1,41 @@
+/**
+ * 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 _DRAW_CCW_CIRCLE_H_
+#define _DRAW_CCW_CIRCLE_H_
+
+#include "../Behavior.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) {};
+
+        /** Actually executes the behavior. */
+        void run();
+};
+
+#endif
diff --git a/scout/libscout/src/behaviors/draw_cw_circle.cpp b/scout/libscout/src/behaviors/draw_cw_circle.cpp
new file mode 100644
index 0000000..2f7a0ac
--- /dev/null
+++ b/scout/libscout/src/behaviors/draw_cw_circle.cpp
@@ -0,0 +1,37 @@
+/**
+ * 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 "draw_cw_circle.h"
+
+void draw_cw_circle::run()
+{
+    while(ok())
+    {
+        motors->set_sides(20, 80, MOTOR_ABSOLUTE);
+
+        spinOnce();
+        loop_rate->sleep();
+    }
+}
diff --git a/scout/libscout/src/behaviors/draw_cw_circle.h b/scout/libscout/src/behaviors/draw_cw_circle.h
new file mode 100644
index 0000000..5a151e2
--- /dev/null
+++ b/scout/libscout/src/behaviors/draw_cw_circle.h
@@ -0,0 +1,41 @@
+/**
+ * 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 _DRAW_CW_CIRCLE_H_
+#define _DRAW_CW_CIRCLE_H_
+
+#include "../Behavior.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) {};
+
+        /** Actually executes the behavior. */
+        void run();
+};
+
+#endif
