@use CeldasMultiSensor. Controller DemoController. CeldasControl : DemoController { + variables: leftWheel, rightWheel (object). leftSensor, rightSensor (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. leftSensor = (vehicle add-sensor at (2.0, .4, 0)). rightSensor = (vehicle add-sensor at (2.0, .4, 0)). + to post-iterate: valueL, valueR (float). valueL = leftSensor get-sensor-value. valueR = rightSensor get-sensor-value. if valueL < 2: leftWheel set-velocity to ((leftWheel get-velocity) + 1). else: leftWheel set-velocity to ((leftWheel get-velocity) - 1). if valueL < 2: rightWheel set-velocity to ((rightWheel get-velocity) + 1). else: rightWheel set-velocity to ((rightWheel get-velocity) - 1). print "leftSensor = $valueL -- rightSensor = $valueR". }