@Override public void run(){
  try {
    while (running) {
      step();
      try {
        Thread.sleep(stepPause);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  NullPointerException e) {
    robotGui.notifyInitialize();
  }
catch (  RobotException e) {
  }
  try {
    runningLock.acquire();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  running=false;
  gui.enableButtons(gui.buttonStateNormal);
  button.setText(gui.autoLocateTitle);
  runningLock.release();
}

@ Override public void run ( ) { try { while ( running ) { step ( ) ; try { Thread . sleep ( stepPause ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } catch ( NullPointerException e ) { robotGui . notifyInitialize ( ) ; } catch ( RobotException e ) { } try { runningLock . acquire ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } running = false ; gui . enableButtons ( gui . buttonStateNormal ) ; button . setText ( gui . autoLocateTitle ) ; runningLock . release ( ) ; }
called upon pressing " auto locate " . this performs the individual steps of the monte - carlo - localization algorithm looped one after the other until the terminating condition is met , that is , the robot is located with sufficient accuracy .
