]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Add tested cars dimensions, refine old one
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 9 Dec 2021 10:49:59 +0000 (11:49 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 9 Dec 2021 10:50:00 +0000 (11:50 +0100)
src/prove_parallel_slot.cc

index 1a335b58914c017b25103ed32156e1ef73ab3ec2..d7944eb26b70d1759527bad0cc8ef17fe484e097 100644 (file)
@@ -8,15 +8,47 @@
 #include <vector>
 #include "pslot.hh"
 
-#define CAR_CURB_TO_CURB 11.031078891255458
-#define CAR_WIDTH 1.771
+// 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;