summaryrefslogtreecommitdiffstats
path: root/Kod/bilbana
diff options
context:
space:
mode:
Diffstat (limited to 'Kod/bilbana')
-rw-r--r--Kod/bilbana/files/Bana2.matbin0 -> 623 bytes
-rw-r--r--Kod/bilbana/files/Bana2.txt81
-rw-r--r--Kod/bilbana/yc4/main.m18
3 files changed, 88 insertions, 11 deletions
diff --git a/Kod/bilbana/files/Bana2.mat b/Kod/bilbana/files/Bana2.mat
new file mode 100644
index 0000000..622fc18
--- /dev/null
+++ b/Kod/bilbana/files/Bana2.mat
Binary files differ
diff --git a/Kod/bilbana/files/Bana2.txt b/Kod/bilbana/files/Bana2.txt
new file mode 100644
index 0000000..bb89c52
--- /dev/null
+++ b/Kod/bilbana/files/Bana2.txt
@@ -0,0 +1,81 @@
+total segment sub_segment v len
+0 1 1 35 300
+30 1 2 40 350
+65 1 3 40 350
+100 1 4 50 350
+135 1 5 50 350
+170 1 6 40 350
+205 1 7 35 350
+240 1 8 30 125
+253 2 1 25 225
+275 2 2 25 300
+305 3 1 30 50
+310 3 2 30 200
+335 3 3 30 200
+360 3 4 30 200
+385 3 5 30 200
+410 3 6 30 200
+435 3 7 30 350
+470 3 8 30 275
+492 4 1 30 325
+524 4 2 30 350
+559 4 3 30 175
+578 4 4 30 175
+594 4 5 30 250
+614 4 6 30 250
+634 4 7 30 90
+643 4 8 30 235
+667 4 9 30 350
+702 4 10 30 250
+722 4 11 30 250
+742 4 12 30 250
+762 5 1 50 200
+787 5 2 50 200
+812 5 3 50 250
+832 5 4 50 250
+852 5 5 50 400
+902 6 1 50 250
+922 6 2 50 250
+942 6 3 50 250
+962 6 4 50 250
+982 6 5 50 250
+1002 6 6 50 350
+1037 6 7 50 350
+1072 7 1 40 200
+1097 7 2 40 90
+1101 7 3 40 250
+1126 7 4 40 250
+1146 7 5 40 350
+1181 7 6 40 200
+1206 7 7 40 235
+1229 7 8 40 235
+1253 7 9 40 250
+1273 7 10 40 350
+1308 7 11 50 175
+1325 7 12 50 200
+1350 7 13 50 200
+1375 7 14 50 200
+1400 7 15 50 175
+1418 7 16 50 200
+1443 7 17 50 200
+1468 8 1 50 250
+1488 8 2 60 200
+1513 8 3 60 175
+1530 8 4 60 200
+1556 8 5 50 200
+1580 8 6 50 235
+1604 8 7 50 350
+1639 8 8 50 200
+1664 8 9 50 200
+1689 8 10 50 350
+1724 8 11 50 175
+1741 8 12 50 350
+1776 9 1 35 200
+1801 9 2 35 200
+1826 9 3 35 350
+1861 9 4 35 350
+1896 9 5 35 175
+1916 9 6 35 200
+1939 9 7 35 200
+1964 9 8 35 315
+1995 9 9 35 \ No newline at end of file
diff --git a/Kod/bilbana/yc4/main.m b/Kod/bilbana/yc4/main.m
index 5c089c9..793aefb 100644
--- a/Kod/bilbana/yc4/main.m
+++ b/Kod/bilbana/yc4/main.m
@@ -46,7 +46,6 @@ car2.seg_len = [0.0 2.53 3.05 4.92 7.60 8.84 10.65 14.68 17.76];
%}
highToc = 0;
-delta_t = 0;
%% ASK ACTIVE CARS
disp('J = Ja (automatiskt), M = Ja (manuellt), N = Nej');
@@ -101,12 +100,10 @@ while 1
if car1.running == true
%% CALC POSITION (CAR 1)
- if car1.lap ~= 0
- if car1.lap > 1
- last_seg_times1 = car1.seg_times(car1.lap - 1, 1:9);
- aprox_v = get_aprox_v(car1.segment, last_seg_times1);
- car1.position = get_position(aprox_v, car1.position, delta_t)
- end
+ if car1.lap > 1
+ last_seg_times1 = car1.seg_times(car1.lap - 1, 1:9);
+ aprox_v = get_aprox_v(car1.segment, last_seg_times1);
+ car1.position = get_position(aprox_v, car1.position, t);
end
if car1.new_check_point == true
% beep;
@@ -188,7 +185,7 @@ while 1
%}
%% CALCULATE (CAR 1)
- if car1.running == true && car1.automatic == true
+ if car1.running == true && car1.automatic == true
car1.car_constant = get_car_constant(1);
car1.v = get_new_v(car1.position, Bana1);
car1.track_u_constant = get_track_u_constant();
@@ -249,8 +246,7 @@ while 1
break;
end
end
-
-
+
send_data_to_display();
end
@@ -267,7 +263,7 @@ matlabclient(3);
%% DISPLAY GRAPHS
if car1.running == true
- graphs(car1.lap_times, 14.25, car1.seg_times, 1);
+ graphs(car1.lap_times, 13.00, car1.seg_times, 1);
end
%{