diff options
| author | Albin <albwa833@student.liu.se> | 2019-11-07 15:46:09 +0100 |
|---|---|---|
| committer | Albin <albwa833@student.liu.se> | 2019-11-07 15:46:09 +0100 |
| commit | 58c9b535208c3dc0945d0b4657f93dccf5474fbc (patch) | |
| tree | c2a507e1bb74cd45e93594461c882963b5d10c70 /Kod/bilbana/yc4/main.m | |
| parent | c397b26df1e6743c26eb9c96b442246ad5ee7d6e (diff) | |
| download | tfyy51-58c9b535208c3dc0945d0b4657f93dccf5474fbc.tar.gz | |
get_new_v fungerar för båda bilarna nu
Diffstat (limited to 'Kod/bilbana/yc4/main.m')
| -rw-r--r-- | Kod/bilbana/yc4/main.m | 7 |
1 files changed, 4 insertions, 3 deletions
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 |
