fix maximum input limit for measured angle
[bachelor-thesis/roomba_tests.git] / main.cc
diff --git a/main.cc b/main.cc
index 13c5403..af67cf5 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -152,7 +152,7 @@ void turn(Roomba& roomba, ControlledMotion& ctrl_motion) {
     measured_angle = getInt(0, "Input measured angle", chargeText(roomba)
       + 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, 359, 1, &ok);
+      "turned:", turn_angle, 0, numeric_limits<int>::max(), 1, &ok);
     if(!ok) {
       break;
     }
@@ -166,7 +166,7 @@ void turn(Roomba& roomba, ControlledMotion& ctrl_motion) {
       << " batt_current=" << roomba().current << endl;
 
     // new orientation
-    cur_angle = (cur_angle + turn_angle) % 360;
+    cur_angle = (cur_angle + measured_angle) % 360;
 
   }
 }
This page took 0.043268 seconds and 4 git commands to generate.