commit 3a73516cb7efbc966fcdb130af4e5c176a4ca90f
Author: Alex <azirbel@andrew.cmu.edu>
Date:   Sun Apr 28 13:32:53 2013 -0400

    Added doxygen documentation to many files.

diff --git a/scout/buttons/src/buttons.cpp b/scout/buttons/src/buttons.cpp
index a1cb64f..01fe8a4 100644
--- a/scout/buttons/src/buttons.cpp
+++ b/scout/buttons/src/buttons.cpp
@@ -27,13 +27,13 @@
  * @file buttons.cpp
  * @brief Contains code to control the buttons.
  *
+ * @defgroup buttons Buttons
+ * @brief Functions for using the buttons
+ *
  * @author Colony Project, CMU Robotics Club
  * @author Priyanka Deo
  * @author Alex Zirbel
  *
- * @defgroup buttons Buttons
- * @brief Functions for using the buttons
- *
  * @{
  **/
 
diff --git a/scout/encoders/src/encoders.cpp b/scout/encoders/src/encoders.cpp
index 6f4bd98..ff44764 100644
--- a/scout/encoders/src/encoders.cpp
+++ b/scout/encoders/src/encoders.cpp
@@ -27,15 +27,13 @@
  * @file encoders.cpp
  * @brief Encoders
  *
- * Implementation of functions for encoder use.
+ * @defgroup encoders Encoders
+ * @brief Functions for using the encoders
  *
  * @author Colony Project, CMU Robotics Club
  * @author Alex Zirbel
  * @author Tom Mullins
 
- * @defgroup encoders Encoders
- * @brief Functions for using the encoders
- *
  * @{
  **/
 
diff --git a/scout/libscout/src/Behavior.cpp b/scout/libscout/src/Behavior.cpp
index a83bbd1..92fe52f 100644
--- a/scout/libscout/src/Behavior.cpp
+++ b/scout/libscout/src/Behavior.cpp
@@ -32,6 +32,11 @@
  * @author Colony Project, CMU Robotics Club
  * @author Priyanka Deo
  * @author Alex Zirbel
+ * 
+ * @defgroup behavior Behavior
+ * @brief Functions which are accessible by all behaviors.
+ *
+ * @{
  **/
 
 #include "Behavior.h"
@@ -120,3 +125,5 @@ void Behavior::wait(float duration)
         r.sleep();
     }
 }
+
+/** @} */
diff --git a/scout/libscout/src/ButtonControl.cpp b/scout/libscout/src/ButtonControl.cpp
index 896f9ac..83e65e6 100644
--- a/scout/libscout/src/ButtonControl.cpp
+++ b/scout/libscout/src/ButtonControl.cpp
@@ -28,13 +28,16 @@
  * @file ButtonControl.cpp
  * @brief Contains buttons declarations and functions
  * 
- * Contains functions and definitions for the use of
- * buttons
+ * @defgroup buttoncontrol ButtonControl
+ * @brief Functions which a behavior can use to control the buttons.
+ * @ingroup behavior
  *
  * @author Colony Project, CMU Robotics Club
  * @author Priyanka Deo
  * @author Leon Zhang
  * @author Alex Zirbel
+ *
+ * @{
  **/
 
 #include "ButtonControl.h"
@@ -85,3 +88,5 @@ bool ButtonControl::button2_is_pressed()
 { 
     return button2_value;
 }
+
+/** @} */
diff --git a/scout/libscout/src/CliffsensorControl.cpp b/scout/libscout/src/CliffsensorControl.cpp
index 6217feb..3a832cb 100644
--- a/scout/libscout/src/CliffsensorControl.cpp
+++ b/scout/libscout/src/CliffsensorControl.cpp
@@ -27,11 +27,15 @@
  * @file CliffsensorControl.cpp
  * @brief Contains code to control the cliffsensor.
  *
- * Implementation of functions for cliffsensor use.
+ * @defgroup motorcontrol MotorControl
+ * @brief Functions which a behavior can use to control the motors.
+ * @ingroup behavior
  *
  * @author Colony Project, CMU Robotics Club
  * @author Priyanka Deo
  * @author Leon Zhang
+ *
+ * @{
  **/
 
 #include "ros/ros.h"
@@ -107,3 +111,5 @@ bool CliffsensorControl::check_is_cliff()
 {
     return (front_raw || left_raw || right_raw);
 }
+
+/** @} */
diff --git a/scout/libscout/src/EncodersControl.cpp b/scout/libscout/src/EncodersControl.cpp
index 79efc6a..587c3c9 100644
--- a/scout/libscout/src/EncodersControl.cpp
+++ b/scout/libscout/src/EncodersControl.cpp
@@ -26,6 +26,10 @@
 /**
  * @file EncodersControl.cpp
  * @brief Contains encoder function implementation
+ *
+ * @defgroup encoderscontrol EncodersControl
+ * @brief Functions which a behavior can use to control the encoders.
+ * @ingroup behavior
  * 
  * @author Colony Project, CMU Robotics Club
  * @author Alex Zirbel
@@ -82,3 +86,5 @@ void EncodersControl::reset()
         ROS_ERROR("EncodersControl reset failed.");
     }
 }
+
+/** @} */
diff --git a/scout/libscout/src/HeadlightControl.cpp b/scout/libscout/src/HeadlightControl.cpp
index bb8b941..5eeb98a 100644
--- a/scout/libscout/src/HeadlightControl.cpp
+++ b/scout/libscout/src/HeadlightControl.cpp
@@ -27,8 +27,9 @@
  * @file HeadlightControl.cpp
  * @brief Contains headlights declarations and functions
  * 
- * Contains functions and definitions for the use of
- * headlights
+ * @defgroup headlightcontrol HeadlightControl
+ * @brief Functions which a behavior can use to control the headlights.
+ * @ingroup behavior
  *
  * @author Colony Project, CMU Robotics Club
  * @author Ben Wasserman
@@ -116,3 +117,5 @@ void HeadlightControl::set_rgb(int red, int green, int blue, int which)
     set_headlights_pub.publish(msg);
     ros::spinOnce();
 }
+
+/** @} */
diff --git a/scout/libscout/src/LinesensorControl.cpp b/scout/libscout/src/LinesensorControl.cpp
index bff934b..6c5255a 100644
--- a/scout/libscout/src/LinesensorControl.cpp
+++ b/scout/libscout/src/LinesensorControl.cpp
@@ -26,9 +26,15 @@
 /**
  * @file LinesensorControl.cpp
  * @brief Contains line following function implementation
+ *
+ * @defgroup linesensorcontrol LinesensorControl
+ * @brief Functions which a behavior can use to control the line sensor.
+ * @ingroup behavior
  * 
  * @author Colony Project, CMU Robotics Club
  * @author Alex Zirbel
+ *
+ * @{
  */
 
 #include "LinesensorControl.h"
@@ -148,3 +154,5 @@ bool LinesensorControl::destination(vector<uint32_t> readings)
     }
     return false;
 }
+
+/** @} */
diff --git a/scout/libscout/src/MotorControl.cpp b/scout/libscout/src/MotorControl.cpp
index 352aa0b..76e1fb4 100644
--- a/scout/libscout/src/MotorControl.cpp
+++ b/scout/libscout/src/MotorControl.cpp
@@ -27,12 +27,15 @@
  * @file MotorControl.cpp
  * @brief Contains motor declarations and functions
  * 
- * Contains functions and definitions for the use of
- * motors
+ * @defgroup motorcontrol MotorControl
+ * @brief Functions which a behavior can use to control the motors.
+ * @ingroup behavior
  *
  * @author Colony Project, CMU Robotics Club
  * @author Ben Wasserman
  * @author Alex Zirbel
+ *
+ * @{
  **/
 
 #include "MotorControl.h"
@@ -298,3 +301,5 @@ float MotorControl::abs_to_rel(float abs_speed, int units)
         return abs_speed;
     }
 }
+
+/** @} */
diff --git a/scout/libscout/src/SonarControl.cpp b/scout/libscout/src/SonarControl.cpp
index 0b56c18..6df1e39 100644
--- a/scout/libscout/src/SonarControl.cpp
+++ b/scout/libscout/src/SonarControl.cpp
@@ -27,11 +27,15 @@
  * @file SonarControl.cpp
  * @brief Contains sonar function implementation
  * 
- * Contains functions for the use of sonar control.
+ * @defgroup sonarcontrol SonarControl
+ * @brief Functions which a behavior can use to control the sonar.
+ * @ingroup behavior
  *
  * @author Colony Project, CMU Robotics Club
  * @author Priyanka Deo
  * @author Alex Zirbel
+ *
+ * @{
  **/
 
 #include "SonarControl.h"
@@ -220,3 +224,5 @@ int* SonarControl::get_sonar_readings()
     //TODO implement later based on sonar readings
 //    return distance;
 //}
+
+/** @} */
diff --git a/scout/libscout/src/WirelessReceiver.cpp b/scout/libscout/src/WirelessReceiver.cpp
index 9d0f7ec..f4dd9b9 100644
--- a/scout/libscout/src/WirelessReceiver.cpp
+++ b/scout/libscout/src/WirelessReceiver.cpp
@@ -28,11 +28,14 @@
  * @file WirelessReceiver.cpp
  * @brief Contains wireless declarations and functions
  * 
- * Contains functions and definitions for the use of
- * XBee wireless
+ * @defgroup wirelessreceiver WirelessReceiver
+ * @brief Contains functions and definitions for the use of XBee wireless
+ * @ingroup behavior
  *
  * @author Colony Project, CMU Robotics Club
  * @author Tom Mullins
+ *
+ * @{
  **/
 
 #include "WirelessReceiver.h"
@@ -79,3 +82,5 @@ void WirelessReceiver::receive(const ::messages::WirelessPacketConstPtr& packet)
 void WirelessReceiver::dummy(std::vector<uint8_t> data) {
     ROS_WARN("Warning: Ignored wireless packet.");
 }
+
+/** @} */
diff --git a/scout/libscout/src/WirelessSender.cpp b/scout/libscout/src/WirelessSender.cpp
index 65becc3..85dada0 100644
--- a/scout/libscout/src/WirelessSender.cpp
+++ b/scout/libscout/src/WirelessSender.cpp
@@ -23,16 +23,18 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-
 /**
  * @file WirelessSender.cpp
  * @brief Contains wireless declarations and functions
  * 
- * Contains functions and definitions for the use of
- * XBee wireless
+ * @defgroup wirelesssender WirelessSender
+ * @brief Contains functions and definitions for the use of XBee wireless
+ * @ingroup behavior
  *
  * @author Colony Project, CMU Robotics Club
  * @author Tom Mullins
+ *
+ * @{
  **/
 
 #include "WirelessSender.h"
@@ -81,3 +83,5 @@ void WirelessSender::send(vector<uint8_t>& data, uint16_t dest)
     packet.data = data;
     pub.publish(packet);
 }
+
+/** @} */
diff --git a/scout/libscout/src/test_behaviors/danger_marking.cpp b/scout/libscout/src/test_behaviors/danger_marking.cpp
index 9c748c7..d7f1d61 100644
--- a/scout/libscout/src/test_behaviors/danger_marking.cpp
+++ b/scout/libscout/src/test_behaviors/danger_marking.cpp
@@ -26,6 +26,7 @@
 #include "danger_marking.h"
 
 #define THRESH 200
+#define min(x,y) ((x < y) ? x : y)
 
 using namespace std;
 
@@ -45,7 +46,7 @@ void danger_marking::run()
     while (true)
     {
         int *readings = sonar->get_sonar_readings();
-        dist = readings[36];
+        dist = min(readings[35], min(readings[36], readings[37]));
 
         ROS_INFO("Dist: %d.", dist);
 
diff --git a/scout/motors/src/motors.cpp b/scout/motors/src/motors.cpp
index b781192..8b13133 100644
--- a/scout/motors/src/motors.cpp
+++ b/scout/motors/src/motors.cpp
@@ -27,14 +27,12 @@
  * @file motors.cpp
  * @brief Contains code to control the motors.
  *
- * Implementation of functions for motor use.
+ * @defgroup motors Motors
+ * @brief Functions for using the motors
  *
  * @author Colony Project, CMU Robotics Club
  * @author Ben Wasserman
  * @author Tom Mullins
-
- * @defgroup motors Motors
- * @brief Functions for using the motors
  *
  * @{
  */
diff --git a/scout/power/src/power.cpp b/scout/power/src/power.cpp
index 873d15e..822ce70 100644
--- a/scout/power/src/power.cpp
+++ b/scout/power/src/power.cpp
@@ -27,13 +27,11 @@
  * @file power.cpp
  * @brief Contains code to monitor and regulate power systems
  *
- * Implementation of power monitor and control
+ * @defgroup power Power
+ * @brief Functions for monitoring and regulating the power systems
  *
  * @author Colony Project, CMU Robotics Club
  * @author Jeff Cooper
-
- * @defgroup power Power
- * @brief Functions for monitoring and regulating the power systems
  *
  * @{
  **/
diff --git a/scout/scoutsim/src/ghost_scout.cpp b/scout/scoutsim/src/ghost_scout.cpp
index f6f4fa4..ea79b14 100644
--- a/scout/scoutsim/src/ghost_scout.cpp
+++ b/scout/scoutsim/src/ghost_scout.cpp
@@ -45,6 +45,13 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/**
+ * @file ghost_scout.cpp
+ *
+ * @ingroup scoutsim
+ * @{
+ */
+
 #include "ghost_scout.h"
 
 #include <wx/wx.h>
@@ -157,3 +164,5 @@ namespace scoutsim
     is_visible = vis;
   }
 }
+
+/** @} */
diff --git a/scout/scoutsim/src/noise_gen.cpp b/scout/scoutsim/src/noise_gen.cpp
index f11b304..9c1f5d0 100644
--- a/scout/scoutsim/src/noise_gen.cpp
+++ b/scout/scoutsim/src/noise_gen.cpp
@@ -27,10 +27,13 @@
  * @file noise_gen.c
  * @brief Contains functions that generate noise for scoutsim sensor data
  *
+ * @ingroup scoutsim
+ *
  * Uses central limit theorem to generate gaussian noise.
  *
  * @author Colony Project, CMU Robotics Club
  * @author Priyanka Deo
+ * @{
  **/
 
 #include "noise_gen.h"
@@ -66,3 +69,5 @@ float get_unit_normal_random()
   sum *= 2.0/(float)n;
   return sum;
 }
+
+/** @} */
diff --git a/scout/scoutsim/src/scout.cpp b/scout/scoutsim/src/scout.cpp
index 9251426..a7a5cb2 100644
--- a/scout/scoutsim/src/scout.cpp
+++ b/scout/scoutsim/src/scout.cpp
@@ -45,6 +45,13 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/**
+ * @file scout.cpp
+ *
+ * @ingroup scoutsim
+ * @{
+ */
+
 #include "scout.h"
 
 #include <wx/wx.h>
@@ -57,6 +64,12 @@ using namespace std;
 
 namespace scoutsim
 {
+    /**
+     * The scout object, which is responsible for refreshing itself and
+     * updating its position and simulated sensors.
+     *
+     * @ingroup scoutsim
+     */
     Scout::Scout(const ros::NodeHandle& nh,
                  const wxImage& scout_image,
                  const Vector2& pos,
@@ -559,3 +572,5 @@ namespace scoutsim
         sonar_visual_on = on;
     }
 }
+
+/** @} */
diff --git a/scout/scoutsim/src/scout_constants.h b/scout/scoutsim/src/scout_constants.h
index cdb276b..0a3bc5c 100644
--- a/scout/scoutsim/src/scout_constants.h
+++ b/scout/scoutsim/src/scout_constants.h
@@ -45,6 +45,13 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/**
+ * @file scout_constants.h
+ *
+ * @ingroup scoutsim
+ * @{
+ */
+
 #ifndef _SCOUTSIM_SCOUT_CONSTANTS_
 #define _SCOUTSIM_SCOUT_CONSTANTS_
 
@@ -91,3 +98,5 @@ namespace scoutsim
 }
 
 #endif
+
+/** @} */
diff --git a/scout/scoutsim/src/scoutsim.cpp b/scout/scoutsim/src/scoutsim.cpp
index cf13280..37f99ea 100644
--- a/scout/scoutsim/src/scoutsim.cpp
+++ b/scout/scoutsim/src/scoutsim.cpp
@@ -43,6 +43,9 @@
  * 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.
+ *
+ * @defgroup scoutsim Scoutsim
+ * @{
  */
 
 #include <wx/app.h>
@@ -139,3 +142,5 @@ END_EVENT_TABLE()
 
 DECLARE_APP(ScoutApp);
 IMPLEMENT_APP(ScoutApp);
+
+/** @} */
diff --git a/scout/scoutsim/src/scoutsim_internal.h b/scout/scoutsim/src/scoutsim_internal.h
index 4ba76c9..fe7c2e7 100644
--- a/scout/scoutsim/src/scoutsim_internal.h
+++ b/scout/scoutsim/src/scoutsim_internal.h
@@ -1,3 +1,9 @@
+/**
+ * @file scoutsim_internal.h
+ *
+ * @ingroup scoutsim
+ * @{
+ */
 
 #ifndef _SCOUTSIM_INTERNAL_
 #define _SCOUTSIM_INTERNAL_
@@ -15,3 +21,5 @@
     } world_state;
 
 #endif /* _SCOUTSIM_INTERNAL_ */
+
+/** @} */
diff --git a/scout/scoutsim/src/sim_frame.cpp b/scout/scoutsim/src/sim_frame.cpp
index 62199a9..31b9b15 100644
--- a/scout/scoutsim/src/sim_frame.cpp
+++ b/scout/scoutsim/src/sim_frame.cpp
@@ -45,6 +45,13 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/**
+ * @file sim_frame.cpp
+ *
+ * @ingroup scoutsim
+ * @{
+ */
+
 #include "sim_frame.h"
 
 #include <stdio.h>
@@ -611,3 +618,5 @@ namespace scoutsim
         wireless_receive.publish(msg);
     }
 }
+
+/** @} */
