diff options
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
+
+
|
