From: Jiri Vlasak Date: Mon, 29 Nov 2021 15:20:20 +0000 (+0100) Subject: Add max cusp as argument X-Git-Tag: v0.8.0~10 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hubacji1/bcar.git/commitdiff_plain/7940e893be10fc3f334bfe1d06171f42459ae9c6 Add max cusp as argument --- diff --git a/src/prove_parallel_slot.cc b/src/prove_parallel_slot.cc index 2748bac..c7a67a6 100644 --- a/src/prove_parallel_slot.cc +++ b/src/prove_parallel_slot.cc @@ -19,11 +19,15 @@ #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