From 58c9b535208c3dc0945d0b4657f93dccf5474fbc Mon Sep 17 00:00:00 2001 From: Albin Date: Thu, 7 Nov 2019 15:46:09 +0100 Subject: =?UTF-8?q?get=5Fnew=5Fv=20fungerar=20f=C3=B6r=20b=C3=A5da=20bilar?= =?UTF-8?q?na=20nu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Kod/bilbana/yc4/main.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Kod/bilbana/yc4/main.m') diff --git a/Kod/bilbana/yc4/main.m b/Kod/bilbana/yc4/main.m index 01691ae..b3c2b56 100644 --- a/Kod/bilbana/yc4/main.m +++ b/Kod/bilbana/yc4/main.m @@ -16,13 +16,14 @@ hf=figure('position',[0 0 eps eps],'menubar','none'); initialize_counters(1) initialize_counters(2) + config_IOs load('bilbana\files\Bana1.mat') load('bilbana\files\Bana2.mat') start_race(1) -% start_race(2) +start_race(2) car1 = struct; car1.running = false; @@ -104,7 +105,7 @@ while 1 %% CALC POSITION (CAR 1) 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); + aprox_v = get_aprox_v(car1.segment, last_seg_times1, 1); car1.position = get_position(aprox_v, car1.position, t); end if car1.new_check_point == true @@ -147,7 +148,7 @@ while 1 %% CALC POSITION (CAR 2 if car2.lap > 1 last_seg_times2 = car2.seg_times(car2.lap - 1, 1:9); - aprox_v = get_aprox_v(car2.segment, last_seg_times2); + aprox_v = get_aprox_v(car2.segment, last_seg_times2, 2); car2.position = get_position(aprox_v, car2.position, t); end if car2.new_check_point == true -- cgit v1.2.1