diff options
| author | vikle012 <viktor.leek@liu.se> | 2019-09-11 13:57:14 +0200 |
|---|---|---|
| committer | vikle012 <viktor.leek@liu.se> | 2019-09-11 13:57:14 +0200 |
| commit | e66efbbe8df2dd4e7de0a1e9bd129cf92e00f92f (patch) | |
| tree | 5ec35be0c219a2e6b017e12e450e76157b9de044 /Kod/bilbana/studentFunctions/init_car.m | |
| download | tfyy51-e66efbbe8df2dd4e7de0a1e9bd129cf92e00f92f.tar.gz | |
Initializes repo.
Diffstat (limited to 'Kod/bilbana/studentFunctions/init_car.m')
| -rw-r--r-- | Kod/bilbana/studentFunctions/init_car.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Kod/bilbana/studentFunctions/init_car.m b/Kod/bilbana/studentFunctions/init_car.m new file mode 100644 index 0000000..8206206 --- /dev/null +++ b/Kod/bilbana/studentFunctions/init_car.m @@ -0,0 +1,25 @@ +function car = init_car(track_number)
+
+car = struct();
+
+% Car state
+car.state = 'intro';
+
+% Track number
+car.track_number = track_number;
+
+% Current track segment
+car.position = 0;
+
+% Current lap
+car.lap = 0;
+
+% Start race timer
+car.t0 = tic();
+
+% Control signal
+car.control = nan(1,1);
+car.control_log_time = nan(1,1);
+car.control_log_position = zeros(1,1);
+
+end
\ No newline at end of file |
