commit 5da152759f1ba8191c2ca8d367a752d87425190a
Author: Alex <azirbel@andrew.cmu.edu>
Date:   Sun Apr 14 15:02:56 2013 -0400

    Added new danger_marking (dumb_run_around) behavior.
    
    This behavior drives until it sees a wall, spins, and keeps going. It lays down the paint if it spies a danger. Yarr.

diff --git a/scout/libscout/src/test_behaviors/danger_marking.cpp b/scout/libscout/src/test_behaviors/danger_marking.cpp
new file mode 100644
index 0000000..9c748c7
--- /dev/null
+++ b/scout/libscout/src/test_behaviors/danger_marking.cpp
@@ -0,0 +1,76 @@
+/**
+ * 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 "danger_marking.h"
+
+#define THRESH 200
+
+using namespace std;
+
+void danger_marking::run()
+{    
+    ROS_INFO("Starting Danger Marking.");
+
+    // Turn the sonar on.
+    sonar->set_on();
+    wait(1.5);
+    sonar->set_single(36);
+
+    motors->set_sides(-20, -20);
+
+    int dist;
+
+    while (true)
+    {
+        int *readings = sonar->get_sonar_readings();
+        dist = readings[36];
+
+        ROS_INFO("Dist: %d.", dist);
+
+        if (dist < THRESH)
+        {
+            ROS_INFO("UH-OH! Get back!");
+            motors->set_sides(30, 30);
+            wait(0.5);
+            motors->set_sides(30, -30);
+            wait(1.0);
+        }
+        else
+        {
+            motors->set_sides(-20, -20);
+            if (metal_detector->query()) //FOUND SOME METAL!
+            {
+                paintboard->set(DISPENSE_PAINT);
+            }
+            else
+            {
+                if(paintboard->query()) //No metal, but dispensing paint;
+                {
+                    paintboard->set(STOP_PAINT);
+                }
+            }
+        }
+    }
+}
diff --git a/scout/libscout/src/test_behaviors/danger_marking.h b/scout/libscout/src/test_behaviors/danger_marking.h
new file mode 100644
index 0000000..3bd09b3
--- /dev/null
+++ b/scout/libscout/src/test_behaviors/danger_marking.h
@@ -0,0 +1,44 @@
+/**
+ * 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 _DANGER_MARKING_H_
+#define _DANGER_MARKING_H_
+
+#include <stdio.h>
+#include "../Behavior.h"
+#include "../Sensors.h"
+
+/**
+ * A very simple maze solver that always turns right.
+ */
+class danger_marking : public Behavior
+{
+    public:
+        danger_marking(std::string scoutname, Sensors* sensors):
+            Behavior(scoutname, "danger_marking", sensors) {};
+        void run();
+};
+#endif
+
