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/update_control.m | |
| download | tfyy51-e66efbbe8df2dd4e7de0a1e9bd129cf92e00f92f.tar.gz | |
Initializes repo.
Diffstat (limited to 'Kod/bilbana/studentFunctions/update_control.m')
| -rw-r--r-- | Kod/bilbana/studentFunctions/update_control.m | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Kod/bilbana/studentFunctions/update_control.m b/Kod/bilbana/studentFunctions/update_control.m new file mode 100644 index 0000000..ee6599c --- /dev/null +++ b/Kod/bilbana/studentFunctions/update_control.m @@ -0,0 +1,16 @@ +function car = update_control(new_control_signal, car_in)
+
+% Return track struct
+car = car_in;
+
+% Update track struct
+car.control(end+1) = new_control_signal;
+car.control_log_time(end+1) = toc(car.t0);
+car.control_log_position(end+1) = car.position;
+
+% Update speed
+set_car_speed(car.track_number, car.control(end));
+
+end
+
+
|
