@use Celdas. Controller DemoController. CeldasControl : DemoController { + variables: sensor (object). leftWheel, rightWheel (object). vehicle (object). n (int). + to init: for n=0, n<10, n++: new CeldasObstacle init at-location (20 * sin(n * 6.28 / 10), 1, 20 * cos(n * 6.28 / 10)). vehicle = new CeldasVehicle. self watch item vehicle. vehicle move to (10, 2, 5). leftWheel = (vehicle add-wheel at (-2, 0, -1.5)). rightWheel = (vehicle add-wheel at (-2, 0, 1.5)). vehicle add-wheel at (1, 0, 0). leftWheel set-velocity to 15.0. rightWheel set-velocity to 15.0. sensor = (vehicle add-sensor at (2.0, .4, 0)). + to post-iterate: value (float). value = sensor get-sensor-value. if value < 1: { leftWheel set-velocity to ((leftWheel get-velocity) + 15). rightWheel set-velocity to ((rightWheel get-velocity) + 15). } else if value > 10: { leftWheel set-velocity to ((leftWheel get-velocity) - 15). rightWheel set-velocity to ((rightWheel get-velocity) - 15). } print value. }