private static void setDestination(IControl control)throws Exception{
			//coordinates of parking slot
			double back_X = destination.getBackBoundaryPosition().getX();
			double back_Y = destination.getBackBoundaryPosition().getY();
			double front_X = destination.getFrontBoundaryPosition().getX();
			double front_Y = destination.getFrontBoundaryPosition().getY();
			//midpoint of parking slot
			double middle_X = (back_X+front_X)/2;
			double middle_Y = (back_Y+front_Y)/2;
			float phi = 0;
			
			if(middle_Y<0){
				phi = 0;
			}
			if(middle_X>1.8){
				phi = (float)Math.PI*1/2;
			}
			if(middle_Y>0.5){
				phi = (float)Math.PI;
			}
			//coordinates on black line, which are supposed to be driven to before parking
			double distance_slot_to_line = 0.3;
			double distance_to_go = 0.2;
			double line_X = middle_X + distance_to_go*Math.cos(phi) - distance_slot_to_line*Math.sin(phi);
			double line_Y = middle_Y + distance_slot_to_line*Math.cos(phi) + distance_to_go*Math.sin(phi);
			
			//offset to improve parking behaviour
			double middle_X_co = middle_X + 0.1*Math.cos (phi);
			double middle_Y_co = middle_Y - 0.1*Math.sin (phi);
			
			//avoid parking maneuver while in the middle of the second corner
			if (line_Y>0.55){
				line_Y = line_Y-0.03;
			}
			destination_pose.setHeading(phi);
			
			//control is only told the the destination if a parking maneuver is supposed to start
			//this triggers the calculation of the trajectory
			if((currentSubStatus == CurrentSubStatus.MOVE_TO_PARKING_POSITION)||(currentSubStatus == CurrentSubStatus.FIND_BLACK_LINE)){
				destination_pose.setLocation((float)line_X, (float)line_Y);
			}
			if(currentSubStatus == CurrentSubStatus.PARK){
				destination_pose.setLocation((float)middle_X_co, (float)middle_Y_co);
				control.setDestination(phi, middle_X_co, middle_Y_co);
			} else {
				//make sound if method fails
				Sound.buzz();;
			}
		}