commit c63c97520e4ba4810364a2b18151db6f250300b8
Author: Alex <azirbel@andrew.cmu.edu>
Date:   Mon Nov 12 21:40:22 2012 -0500

    Scoutsim now has consistent units of m and m/s.
    
    This will cause some problems.
    
     * Behaviors which relied on the old units will have to change. We need to change the Control classes to scale things right.
     * Encoder ticks are almost fixed, but not quite right (I think because of a rounding problem).
     * Speeds are now all in m/s, which is much different than before - we'll have to change the Control class somehow.
    
    I'm afraid I'm out of time to make the rest of these changes now, but I'll do them ASAP.

diff --git a/scout/scoutsim/src/sim_frame.cpp b/scout/scoutsim/src/sim_frame.cpp
index 88d6103..6028537 100644
--- a/scout/scoutsim/src/sim_frame.cpp
+++ b/scout/scoutsim/src/sim_frame.cpp
@@ -68,7 +68,7 @@ namespace scoutsim
         srand(time(NULL));
 
         update_timer = new wxTimer(this);
-        update_timer->Start(16);
+        update_timer->Start(SCOUTSIM_REFRESH_RATE * 1000);
 
         Connect(update_timer->GetId(), wxEVT_TIMER,
                 wxTimerEventHandler(SimFrame::onUpdate), NULL, this);
@@ -77,9 +77,6 @@ namespace scoutsim
 
         images_path = ros::package::getPath("scoutsim") + "/images/";
 
-        // 200 pixels per meter. @todo make this a constant elsewhere.
-        meter = 200;
-
         map_base_name =  ros::package::getPath("scoutsim") + "/maps/" +
                            map_name + ".bmp";
         map_lines_name = ros::package::getPath("scoutsim") + "/maps/" +
@@ -160,8 +157,8 @@ namespace scoutsim
 
         SetMenuBar(menuBar);
 
-        width_in_meters = GetSize().GetWidth() / meter;
-        height_in_meters = GetSize().GetHeight() / meter;
+        width_in_meters = GetSize().GetWidth() / PIX_PER_METER;
+        height_in_meters = GetSize().GetHeight() / PIX_PER_METER;
     }
 
     SimFrame::~SimFrame()
@@ -314,6 +311,7 @@ namespace scoutsim
         SetSize(wxSize(path_bitmap.GetWidth(), path_bitmap.GetHeight()));
     }
 
+    // Runs every SCOUTSIM_REFRESH_RATE.
     void SimFrame::onUpdate(wxTimerEvent& evt)
     {
         ros::spinOnce();
@@ -393,13 +391,13 @@ namespace scoutsim
         }
         else if (wxGetKeyState(WXK_LEFT))
         {
-            teleop_l_speed = -TELEOP_PRECISE_SPEED;
-            teleop_r_speed = TELEOP_PRECISE_SPEED;
+            teleop_l_speed = -TELEOP_PRECISE_SPEED * 2;
+            teleop_r_speed = TELEOP_PRECISE_SPEED * 2;
         }
         else if (wxGetKeyState(WXK_RIGHT))
         {
-            teleop_l_speed = TELEOP_PRECISE_SPEED;
-            teleop_r_speed = -TELEOP_PRECISE_SPEED;
+            teleop_l_speed = TELEOP_PRECISE_SPEED * 2;
+            teleop_r_speed = -TELEOP_PRECISE_SPEED * 2;
         }
     }
 
@@ -407,28 +405,28 @@ namespace scoutsim
     {
         if (wxGetKeyState(WXK_UP))
         {
-            teleop_fluid_speed += 2;
+            teleop_fluid_speed += TELEOP_FLUID_INC * 2;
         }
         else if (wxGetKeyState(WXK_DOWN))
         {
-            teleop_fluid_speed -= 2;
+            teleop_fluid_speed -= TELEOP_FLUID_INC * 2;
         }
         else if (teleop_fluid_speed > 0)
         {
-            teleop_fluid_speed -= 1;
+            teleop_fluid_speed -= TELEOP_FLUID_INC;
         }
         else if (teleop_fluid_speed < 0)
         {
-            teleop_fluid_speed += 1;
+            teleop_fluid_speed += TELEOP_FLUID_INC;
         }
 
         if (wxGetKeyState(WXK_LEFT))
         {
-            teleop_fluid_omega -= 1;
+            teleop_fluid_omega -= TELEOP_FLUID_INC;
         }
         else if (wxGetKeyState(WXK_RIGHT))
         {
-            teleop_fluid_omega += 1;
+            teleop_fluid_omega += TELEOP_FLUID_INC;
         }
         else
         {
@@ -439,10 +437,18 @@ namespace scoutsim
         {
             teleop_fluid_speed = TELEOP_FLUID_MAX_SPEED;
         }
+        else if (teleop_fluid_speed < -TELEOP_FLUID_MAX_SPEED)
+        {
+            teleop_fluid_speed = -TELEOP_FLUID_MAX_SPEED;
+        }
         if (teleop_fluid_omega > TELEOP_FLUID_MAX_SPEED / 2)
         {
             teleop_fluid_omega = TELEOP_FLUID_MAX_SPEED / 2;
         }
+        else if (teleop_fluid_omega < -TELEOP_FLUID_MAX_SPEED / 2)
+        {
+            teleop_fluid_omega = -TELEOP_FLUID_MAX_SPEED / 2;
+        }
 
         teleop_l_speed = teleop_fluid_speed + teleop_fluid_omega;
         teleop_r_speed = teleop_fluid_speed - teleop_fluid_omega;
