diff options
Diffstat (limited to 'Kod/bilbana')
| -rw-r--r-- | Kod/bilbana/Graph/graphs_test.m | 12 | ||||
| -rw-r--r-- | Kod/bilbana/yc4/get_car_constant.m | 2 | ||||
| -rw-r--r-- | Kod/bilbana/yc4/main.m | 20 |
3 files changed, 23 insertions, 11 deletions
diff --git a/Kod/bilbana/Graph/graphs_test.m b/Kod/bilbana/Graph/graphs_test.m index 955aeee..248e6da 100644 --- a/Kod/bilbana/Graph/graphs_test.m +++ b/Kod/bilbana/Graph/graphs_test.m @@ -14,6 +14,12 @@ ref_lap_time = 14; %% Actual test graphs(car1.lap_times,ref_lap_time,car1.seg_times,5) %} -position = 2.54; -segment = 2; -detect_missed(position,segment,1)
\ No newline at end of file +ref_time = input('Vilken referenstid ska användas? [13] ', 's'); +ref_time = str2double(ref_time); +if isnan(ref_time) + ref_time = 13; +elseif not(isreal(ref_time)) + ref_time = 13; +end +disp(ref_time) +disp(ref_time*2) diff --git a/Kod/bilbana/yc4/get_car_constant.m b/Kod/bilbana/yc4/get_car_constant.m index e5e9801..5513721 100644 --- a/Kod/bilbana/yc4/get_car_constant.m +++ b/Kod/bilbana/yc4/get_car_constant.m @@ -15,7 +15,7 @@ switch(in_pos) case 1 car_constant = 0.95; case 2 - car_constant = 1.2; + car_constant = 0.8; end end diff --git a/Kod/bilbana/yc4/main.m b/Kod/bilbana/yc4/main.m index 20bc4ee..8ee18b2 100644 --- a/Kod/bilbana/yc4/main.m +++ b/Kod/bilbana/yc4/main.m @@ -39,7 +39,6 @@ car1.segment = 1; car1.lap = 0; car1.lap_times = []; car1.seg_times = []; -car1.last_seg_times = []; car1.position = 0; car1.seg_len = [0.0 2.53 3.05 4.73 7.68 8.98 10.93 14.69 17.57]; car1.map = Bana1; @@ -54,11 +53,10 @@ car2.segment = 1; car2.lap = 0; car2.lap_times = []; car2.seg_times = []; -car2.last_seg_times = []; car2.position = 0; car2.seg_len = [0.0 2.53 3.05 4.92 7.60 8.84 10.65 14.68 17.76]; car2.map = Bana2; -car2.miss_probability = 0.0; +car2.miss_probability = 0.05; t = 0; highToc = 0; @@ -88,8 +86,16 @@ elseif car2.response == 'M' else car2.running = false; end - - +%{ +ref_time = input('Vilken referenstid ska användas? [13] ', 's'); +ref_time = str2double(ref_time); +if isnan(ref_time) + ref_time = 13; +elseif not(isreal(ref_time)) + ref_time = 13; +end +%} +ref_time = 13; %% MAIN LOOP while 1 readTime = tic; @@ -171,10 +177,10 @@ matlabclient(3); %% DISPLAY GRAPHS if car1.running == true - graphs(car1.lap_times, 13, car1.seg_times, 1); + graphs(car1.lap_times, ref_time, car1.seg_times, 1); end if car2.running == true - graphs(car2.lap_times, 13, car2.seg_times, 2); + graphs(car2.lap_times, ref_time, car2.seg_times, 2); end |
