turn: allow negative values for orientation input, but only positive for velocity master
authorRoland Hieber <rohieb@rohieb.name>
Thu, 20 Jan 2011 14:14:24 +0000 (15:14 +0100)
committerRoland Hieber <rohieb@rohieb.name>
Thu, 20 Jan 2011 15:30:16 +0000 (16:30 +0100)
main.cc

diff --git a/main.cc b/main.cc
index e373c51..c02d17e 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -227,7 +227,7 @@ void turn(Roomba& roomba, ControlledMotion& ctrl_motion) {
   while(true) {
     // new turn velocity
     velocity = getInt(0, "Input velocity", chargeText()
-      + "Input turn velocity in mm/sec:", velocity, -500, 500, 10, &ok);
+      + "Input turn velocity in mm/sec:", velocity, 0, 500, 10, &ok);
     if(!ok) {
       break;
     }
@@ -246,9 +246,10 @@ void turn(Roomba& roomba, ControlledMotion& ctrl_motion) {
 
     // new current angle
     measured_angle = getInt(0, "Input measured angle", chargeText() + QString(
-      "Orientation should be %1 degree now.\n\n").arg((cur_angle + turn_angle)
-      % 360) + "Input measured angle in degree the Roomba has "
-      "turned:", turn_angle, 0, numeric_limits<int>::max(), 1, &ok);
+      "Orientation should be %1 degree now.\n\n").arg((cur_angle + turn_angle
+      + 360) % 360) + "Input measured angle in degree the Roomba has turned:",
+      turn_angle, numeric_limits<int>::min(), numeric_limits<int>::max(), 1,
+      &ok);
     if(!ok) {
       break;
     }
This page took 0.026908 seconds and 4 git commands to generate.