summaryrefslogtreecommitdiffstats
path: root/Kod/bilbana/yc4/main.m
diff options
context:
space:
mode:
authoralex <aletu130@student.liu.se>2019-11-05 17:42:20 +0100
committeralex <aletu130@student.liu.se>2019-11-05 17:42:20 +0100
commitc242c4482aa66d6a002579f5184d6cbb9a4e4835 (patch)
treeaf2bc1a936ecde4254fe416cefe7d87bdf4c1d21 /Kod/bilbana/yc4/main.m
parent2a9260509b73bba56171d9478142c79ef5b91cec (diff)
downloadtfyy51-c242c4482aa66d6a002579f5184d6cbb9a4e4835.tar.gz
Master buggfixad
Diffstat (limited to 'Kod/bilbana/yc4/main.m')
-rw-r--r--Kod/bilbana/yc4/main.m18
1 files changed, 7 insertions, 11 deletions
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
%{