ApartmentSimEnvironment UpdateCameraView /EyePosition:5 2 14 /LookAtPoint:3 0 12 AddDifferentialDriveEntity base1 /Position:3.5 0 12 /Orientation:0 0 0 AddLaserRangeFinderEntity lrf1 /Position:0 0.4 0 /ParentEntity:base1 /Procedure_SensorNotify:proc_lrf1 AddDifferentialDriveEntity base2 /Position:2.5 0 12 /Orientation:0 30 0 AddLaserRangeFinderEntity lrf2 /Position:0 0.4 0 /ParentEntity:base2 /Procedure_SensorNotify:proc_lrf2 FlushScript base1.Go(0.1) base2.Go(0.1) Procedure proc_lrf1 call action_logic(value, base1) End Procedure proc_lrf2 call action_logic(value, base2) End Procedure action_logic(lrf, base) d1 = lrf.DistanceMeasurements[90] d2 = lrf.DistanceMeasurements[180] d3 = lrf.DistanceMeasurements[270] if (d1 < 1000 || d2 < 1000) { base.Turn(90, 1.0) base.Go(0.1) } else { if (d3 < 1000) { base.Turn(-90, 1.0) base.Go(0.1) } } End