diff options
| author | Albin <albwa833@student.liu.se> | 2019-11-07 15:03:03 +0100 |
|---|---|---|
| committer | Albin <albwa833@student.liu.se> | 2019-11-07 15:03:03 +0100 |
| commit | fe544c6468464732bb64106f696bd6ffedade085 (patch) | |
| tree | feaff741dfe8b5e6084fd08c366d05270965c1a8 /Kod/bilbana/yc4/choose_position.m | |
| parent | 8ee1f181cf46e653dbfc99d4d2e41855df925447 (diff) | |
| download | tfyy51-fe544c6468464732bb64106f696bd6ffedade085.tar.gz | |
Nästan fungerande primitiv hantering av missade givare
Diffstat (limited to 'Kod/bilbana/yc4/choose_position.m')
| -rw-r--r-- | Kod/bilbana/yc4/choose_position.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Kod/bilbana/yc4/choose_position.m b/Kod/bilbana/yc4/choose_position.m index ae900d6..035d6e3 100644 --- a/Kod/bilbana/yc4/choose_position.m +++ b/Kod/bilbana/yc4/choose_position.m @@ -17,18 +17,20 @@ for i = 1:length(track_len) if i == 1 near = [i,diff]; else - if diff < near(i) + if diff < near(2) near = [i,diff]; end end end +disp(near); %% Beräkning av passerad givare if near(1) == segment new_position = set_pos( track, segment); seg_plus = 0; + disp('In right segment'); else seg_plus = near(1) - segment - new_position = set_pos( track, segment) + new_position = set_pos( track, segment + seg_plus) beep end % TODO Bättre att utgå ifrån ingen missad givare ifall ingen annan givare |
