]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - src/prove_parallel_slot.cc
Rename entries to ispaths
[hubacji1/bcar.git] / src / prove_parallel_slot.cc
index c7a67a602c5ef564d121e5224d4e6d09701573e2..dd46f45bb41bd1881b719f1d3b6943d7cc00b839 100644 (file)
@@ -8,15 +8,47 @@
 #include <vector>
 #include "pslot.hh"
 
-#define CAR_CURB_TO_CURB 10.820
-#define CAR_WIDTH 1.625
-#define CAR_WHEELBASE 2.450
-#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.105
-#define CAR_LENGTH 3.760
+// Car dimensions taken from www.car.info
+
+//// Opel Corsa
+//#define SLOT_START_WIDTH_MULTIPLIER 2.0
+//#define CAR_CURB_TO_CURB 9.900
+//#define CAR_FRONT_TRACK 1.320
+//#define CAR_WIDTH 1.532 // 1.944 // with mirrors
+//#define CAR_WHEELBASE 2.343
+//#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.212
+//#define CAR_LENGTH 3.622
+
+//// Wolkswagen transporter
+//#define SLOT_START_WIDTH_MULTIPLIER 12.4
+//#define CAR_CURB_TO_CURB 13.200
+//#define CAR_FRONT_TRACK 1.904
+//#define CAR_WIDTH 1.994 // 2.297 // with mirrors
+//#define CAR_WHEELBASE 3.400
+//#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 4.308
+//#define CAR_LENGTH 5.500
+
+//// Mercedes-Benz AMG GT
+//#define SLOT_START_WIDTH_MULTIPLIER 9.8
+//#define CAR_CURB_TO_CURB 11.470
+//#define CAR_FRONT_TRACK 1.678
+//#define CAR_WIDTH 1.939 // 2.075 // with mirrors
+//#define CAR_WHEELBASE 2.630
+//#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.528
+//#define CAR_LENGTH 4.544
+
+// Renault ZOE (vorobieva, computed ctc)
+#define SLOT_START_WIDTH_MULTIPLIER 4.5
+#define CAR_CURB_TO_CURB 10.802166641822163
+#define CAR_FRONT_TRACK 1.511
+#define CAR_WIDTH 1.771 // 1.945 // with mirrors
+#define CAR_WHEELBASE 2.588
+#define CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT 3.427
+#define CAR_LENGTH 4.084
 
-#define SLOT_MAX_WIDTH 2.2
 #define SLOT_STEP_LENGTH 0.01
 #define SLOT_STEP_WIDTH 0.01
+#define SLOT_MAX_WIDTH (CAR_WIDTH + (SLOT_START_WIDTH_MULTIPLIER + 40) * SLOT_STEP_WIDTH)
 
 #define PARKING_SPEED -0.001
 #define DELTA_ANGLE_TO_SLOT 0.0001
@@ -33,6 +65,7 @@ int main(int argc, char** argv)
 
        bcar::BicycleCar c;
        c.ctc(CAR_CURB_TO_CURB);
+       c.ft(CAR_FRONT_TRACK);
        c.w(CAR_WIDTH);
        c.wb(CAR_WHEELBASE);
        c.df(CAR_DISTANCE_FROM_REAR_AXLE_TO_FRONT);
@@ -40,7 +73,7 @@ int main(int argc, char** argv)
 
        bcar::Point zp(0.0, 0.0);
        double zh = 0.0;
-       double w = c.w() + 4.5 * SLOT_STEP_WIDTH;
+       double w = c.w() + SLOT_START_WIDTH_MULTIPLIER * SLOT_STEP_WIDTH;
 
        while (w < SLOT_MAX_WIDTH) {
                double len = c.len() + SLOT_STEP_LENGTH;
@@ -52,7 +85,16 @@ int main(int argc, char** argv)
                        auto pr = s.fe(c);
                        if (!(pr.x() == 0.0 && pr.y() == 0.0 && pr.b() == 0.0
                                        && pr.e() == 0.0)) {
-                               std::cout << w << " " << len << std::endl;
+                               std::cout << w << " " << len << " ";
+                               std::cout << max_cusp << " ";
+                               std::cout << s._ispaths.size() << " ";
+                               auto f = s._ispaths.front().front();
+                               auto b = s._ispaths.back().front();
+                               std::cout << f.x() << " " << f.y() << " ";
+                               std::cout << f.h() << " ";
+                               std::cout << b.x() << " " << b.y() << " ";
+                               std::cout << b.h() << " ";
+                               std::cout << std::endl;
                                break;
                        }
                        len += SLOT_STEP_LENGTH;