2 * SPDX-FileCopyrightText: 2021 Jiri Vlasak <jiri.vlasak.2@cvut.cz>
4 * SPDX-License-Identifier: GPL-3.0-only
11 #define CAR_CURB_TO_CURB 10.802166641822163
12 #define CAR_FRONT_TRACK 1.511
13 #define CAR_WIDTH 1.771
14 #define CAR_WHEELBASE 2.588
15 #define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.427
16 #define CAR_LENGTH 4.084
18 #define SLOT_MAX_WIDTH (CAR_WIDTH + 0.5)
19 #define SLOT_STEP_WIDTH 0.01
21 #define PARKING_SPEED -0.001
22 #define DELTA_ANGLE_TO_SLOT 0.0001
24 int main(int argc, char** argv)
27 std::cerr << "Number of direction changes needed." << std::endl;
30 int max_cusp = atoi(argv[1]);
31 double slot_length = atof(argv[2]);
32 std::cout << std::fixed;
33 std::cerr << std::fixed;
36 c.ctc(CAR_CURB_TO_CURB);
37 c.ft(CAR_FRONT_TRACK);
40 c.df(CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT);
43 bcar::Point zp(0.0, 0.0);
46 for (double w = c.w() + 4.5 * SLOT_STEP_WIDTH; w < SLOT_MAX_WIDTH;
47 w += SLOT_STEP_WIDTH) {
48 bcar::ParkingSlot s(zp, zh, w, slot_length);
49 s.set_parking_speed(PARKING_SPEED);
50 s.set_max_cusp(max_cusp);
51 s.set_delta_angle_to_slot(DELTA_ANGLE_TO_SLOT);
55 if (s._ispaths.size() > 0) {
56 for (unsigned int i = 1; i < s._ispaths.size(); i++) {
57 double dd = std::abs(s._ispaths[i].front().h()
58 - s._ispaths[i - 1].front().h());
66 std::cout << w << " " << slot_length << " ";
67 std::cout << max_cusp << " ";
68 std::cout << d << " " << fd << " " << cd;
69 std::cout << std::endl;