public void goTo(){
    	boolean bol=false;
    	pos2D.setSpeed(0.3, 0);
    	while(!bol){
    		while(!sonar.isDataReady());
    		double[] sonarValues = sonar.getData().getRanges();
    		if(sonarValues[0]<0.5 ||sonarValues[1]<0.5){
    			pos2D.setSpeed(0, 0);
    			avoidObs();
    		}
    		
       	while(!pos2D.isDataReady());
       	if(inRange(pos2D.getX(), x)&&inRange(pos2D.getY(),y)){
       		pos2D.setSpeed(0, 0);
       		bol=true;
       		System.exit(1);
       	}
       	try {Thread.sleep(10);} catch (InterruptedException e) {}
    }
    }