2 * SPDX-FileCopyrightText: 2021 Jiri Vlasak <jiri.vlasak.2@cvut.cz>
4 * SPDX-License-Identifier: GPL-3.0-only
11 // Car dimensions taken from www.car.info
14 //#define SLOT_START_WIDTH_MULTIPLIER 2.0
15 //#define CAR_CURB_TO_CURB 9.900
16 //#define CAR_FRONT_TRACK 1.320
17 //#define CAR_WIDTH 1.532 // 1.944 // with mirrors
18 //#define CAR_WHEELBASE 2.343
19 //#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.212
20 //#define CAR_LENGTH 3.622
22 //// Wolkswagen transporter
23 //#define SLOT_START_WIDTH_MULTIPLIER 12.4
24 //#define CAR_CURB_TO_CURB 13.200
25 //#define CAR_FRONT_TRACK 1.904
26 //#define CAR_WIDTH 1.994 // 2.297 // with mirrors
27 //#define CAR_WHEELBASE 3.400
28 //#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 4.308
29 //#define CAR_LENGTH 5.500
31 //// Mercedes-Benz AMG GT
32 //#define SLOT_START_WIDTH_MULTIPLIER 9.8
33 //#define CAR_CURB_TO_CURB 11.470
34 //#define CAR_FRONT_TRACK 1.678
35 //#define CAR_WIDTH 1.939 // 2.075 // with mirrors
36 //#define CAR_WHEELBASE 2.630
37 //#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.528
38 //#define CAR_LENGTH 4.544
40 // Renault ZOE (vorobieva, computed ctc)
41 #define SLOT_START_WIDTH_MULTIPLIER 4.5
42 #define CAR_CURB_TO_CURB 10.802166641822163
43 #define CAR_FRONT_TRACK 1.511
44 #define CAR_WIDTH 1.771 // 1.945 // with mirrors
45 #define CAR_WHEELBASE 2.588
46 #define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.427
47 #define CAR_LENGTH 4.084
49 #define SLOT_STEP_LENGTH 0.01
50 #define SLOT_STEP_WIDTH 0.01
51 #define SLOT_MAX_WIDTH (CAR_WIDTH + (SLOT_START_WIDTH_MULTIPLIER + 40) * SLOT_STEP_WIDTH)
53 #define PARKING_SPEED -0.001
54 #define DELTA_ANGLE_TO_SLOT 0.0001
56 int main(int argc, char** argv)
59 std::cerr << "Number of direction changes needed." << std::endl;
62 int max_cusp = atoi(argv[1]);
63 std::cout << std::fixed;
64 std::cerr << std::fixed;
67 c.ctc(CAR_CURB_TO_CURB);
68 c.ft(CAR_FRONT_TRACK);
71 c.df(CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT);
74 bcar::Point zp(0.0, 0.0);
76 double w = c.w() + SLOT_START_WIDTH_MULTIPLIER * SLOT_STEP_WIDTH;
78 while (w < SLOT_MAX_WIDTH) {
79 double len = c.len() + SLOT_STEP_LENGTH;
81 bcar::ParkingSlot s(zp, zh, w, len);
82 s.set_parking_speed(PARKING_SPEED);
83 s.set_max_cusp(max_cusp);
84 s.set_delta_angle_to_slot(DELTA_ANGLE_TO_SLOT);
86 if (!(pr.x() == 0.0 && pr.y() == 0.0 && pr.b() == 0.0
88 std::cout << w << " " << len << " ";
89 std::cout << max_cusp << " ";
90 std::cout << pr.x() << " " << pr.y() << " ";
91 std::cout << pr.b() << " " << pr.e() << " ";
92 std::cout << std::endl;
95 len += SLOT_STEP_LENGTH;