]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Add max cusp as argument
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 29 Nov 2021 15:20:20 +0000 (16:20 +0100)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Mon, 29 Nov 2021 15:20:38 +0000 (16:20 +0100)
src/prove_parallel_slot.cc

index 2748bacf981f28dcc8b8881a0cb0b7e84867fb36..c7a67a602c5ef564d121e5224d4e6d09701573e2 100644 (file)
 #define SLOT_STEP_WIDTH 0.01
 
 #define PARKING_SPEED -0.001
-#define MAX_CUSP 10
 #define DELTA_ANGLE_TO_SLOT 0.0001
 
-int main()
+int main(int argc, char** argv)
 {
+       if (argc != 2) {
+               std::cerr << "Number of direction changes needed." << std::endl;
+               exit(1);
+       }
+       int max_cusp = atoi(argv[1]);
        std::cout << std::fixed;
        std::cerr << std::fixed;
 
@@ -43,7 +47,7 @@ int main()
                while (true) {
                        bcar::ParkingSlot s(zp, zh, w, len);
                        s.set_parking_speed(PARKING_SPEED);
-                       s.set_max_cusp(MAX_CUSP);
+                       s.set_max_cusp(max_cusp);
                        s.set_delta_angle_to_slot(DELTA_ANGLE_TO_SLOT);
                        auto pr = s.fe(c);
                        if (!(pr.x() == 0.0 && pr.y() == 0.0 && pr.b() == 0.0