blob: 069e8f5f1c651ee0564886c37624b457c7f91aa4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
function car = car_controller(car_in)
car = car_in;
% Read sensors
[car, cp_passed] = update_position(car);
if cp_passed
% Update speed
new_control = car.control(end) + 0.5*(rand() - 0.5); % Temporary control policy
car = update_control(new_control, car);
end
end
|