diff options
| author | aletu130 <aletu130@student.liu.se> | 2019-11-07 15:06:45 +0100 |
|---|---|---|
| committer | aletu130 <aletu130@student.liu.se> | 2019-11-07 15:06:45 +0100 |
| commit | c397b26df1e6743c26eb9c96b442246ad5ee7d6e (patch) | |
| tree | 6f63022f923b7934d168c222944c071be9c36d03 /Kod/bilbana/yc4/main.m | |
| parent | ec633751d4906409e6054a0d2cc3f44e9ae7f037 (diff) | |
| download | tfyy51-c397b26df1e6743c26eb9c96b442246ad5ee7d6e.tar.gz | |
ändrade get_new_v.m så att den blir kompatibel för två bilar
Diffstat (limited to 'Kod/bilbana/yc4/main.m')
| -rw-r--r-- | Kod/bilbana/yc4/main.m | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Kod/bilbana/yc4/main.m b/Kod/bilbana/yc4/main.m index 6fd0172..01691ae 100644 --- a/Kod/bilbana/yc4/main.m +++ b/Kod/bilbana/yc4/main.m @@ -144,14 +144,12 @@ while 1 %% CHECK LAP AND CHECKPOINT (CAR 2) if car2.running == true - %% CALC POSITION (CAR 2) - if car2.lap ~= 0 - 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); - car2.position = get_position(aprox_v, car2.position, t); - end - end + %% 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); + car2.position = get_position(aprox_v, car2.position, t); + end if car2.new_check_point == true % beep; if car2.lap ~= 0 |
