commit 144137a12c1437f71d49b144279823dc836cb14b
Author: Alex Zirbel <azirbel@andrew.cmu.edu>
Date:   Mon Dec 26 16:15:35 2011 -0500

    Got motor control working with scoutsim
    
    Behaviors can now use the MotorControl class to change the speed of the motors in the simulator. The simulator correctly handles the command.
    At the moment, the set_motors command is limited to 'scout1'. We should look into prefixes to specify which scout (scout1, scout2, etc) each behavior should command.
    Also changed alex_behavior to be a good demonstration of the motors.

diff --git a/scout/scoutsim/src/scout.h b/scout/scoutsim/src/scout.h
index 40d2dbc..44fdede 100644
--- a/scout/scoutsim/src/scout.h
+++ b/scout/scoutsim/src/scout.h
@@ -9,8 +9,8 @@
  * @author Alex Zirbel
  */
 
-#ifndef SCOUTSIM_SCOUT_H
-#define SCOUTSIM_SCOUT_H
+#ifndef _SCOUTSIM_SCOUT_H_
+#define _SCOUTSIM_SCOUT_H_
 
 #include <ros/ros.h>
 #include <boost/shared_ptr.hpp>
@@ -18,7 +18,6 @@
 #include <motors/set_motors.h>
 
 #include <scoutsim/Pose.h>
-#include <scoutsim/Velocity.h>
 #include <scoutsim/SetPen.h>
 #include <scoutsim/TeleportRelative.h>
 #include <scoutsim/TeleportAbsolute.h>
@@ -27,6 +26,8 @@
 #include <wx/wx.h>
 
 #define PI 3.14159265
+/// The scale factor so the speed of scout robots is reasonable for the sim
+#define SPEED_SCALE_FACTOR 0.05
 
 namespace scoutsim
 {
@@ -37,9 +38,9 @@ namespace scoutsim
               , y(0.0)
         {}
 
-        Vector2(float _x, float _y)
-            : x(_x)
-              , y(_y)
+        Vector2(float new_x, float new_y)
+            : x(new_x)
+              , y(new_y)
         {}
 
         bool operator==(const Vector2& rhs)
@@ -69,7 +70,6 @@ namespace scoutsim
 
         private:
             void setMotors(const motors::set_motors::ConstPtr& msg);
-            void velocityCallback(const VelocityConstPtr& vel);
             bool setPenCallback(scoutsim::SetPen::Request&,
                                 scoutsim::SetPen::Response&);
             bool teleportRelativeCallback(scoutsim::TeleportRelative::Request&,
@@ -77,45 +77,44 @@ namespace scoutsim
             bool teleportAbsoluteCallback(scoutsim::TeleportAbsolute::Request&,
                                           scoutsim::TeleportAbsolute::Response&);
 
-            ros::NodeHandle n_;
+            ros::NodeHandle node;
 
-            wxImage scout_image_;
-            wxBitmap scout_;
+            wxImage scout_image;
+            wxBitmap scout;
 
-            Vector2 pos_;
-            float orient_;
+            Vector2 pos;
+            float orient;
 
             // Keep track of the last commanded speeds sent to the sim
-            int motor_fl_speed_;
-            int motor_fr_speed_;
-            int motor_bl_speed_;
-            int motor_br_speed_;
+            int motor_fl_speed;
+            int motor_fr_speed;
+            int motor_bl_speed;
+            int motor_br_speed;
 
-            float lin_vel_;
-            float ang_vel_;
-            bool pen_on_;
-            wxPen pen_;
+            float lin_vel;
+            float ang_vel;
+            bool pen_on;
+            wxPen pen;
 
-            ros::Subscriber motors_sub_;
-            ros::Subscriber velocity_sub_;
-            ros::Publisher pose_pub_;
-            ros::Publisher color_pub_;
-            ros::ServiceServer set_pen_srv_;
-            ros::ServiceServer teleport_relative_srv_;
-            ros::ServiceServer teleport_absolute_srv_;
+            ros::Subscriber motors_sub;
+            ros::Publisher pose_pub;
+            ros::Publisher color_pub;
+            ros::ServiceServer set_pen_srv;
+            ros::ServiceServer teleport_relative_srv;
+            ros::ServiceServer teleport_absolute_srv;
 
-            ros::WallTime last_command_time_;
+            ros::WallTime last_command_time;
 
-            float meter_;
+            float meter;
 
             struct TeleportRequest
             {
-                TeleportRequest(float x, float y, float _theta,
-                                float _linear, bool _relative)
+                TeleportRequest(float x, float y, float new_theta,
+                                float new_linear, bool new_relative)
                     : pos(x, y)
-                      , theta(_theta)
-                      , linear(_linear)
-                      , relative(_relative)
+                      , theta(new_theta)
+                      , linear(new_linear)
+                      , relative(new_relative)
                 {}
 
                 Vector2 pos;
@@ -125,7 +124,7 @@ namespace scoutsim
             };
 
             typedef std::vector<TeleportRequest> V_TeleportRequest;
-            V_TeleportRequest teleport_requests_;
+            V_TeleportRequest teleport_requests;
     };
     typedef boost::shared_ptr<Scout> ScoutPtr;
 
