private synchronized void processOutputs() {
		
		try
		{
			// write status - this has the highest transmission priority, thus it is executed first if thread gets interrupted early 
			hmi.dataOut.writeInt(Command.OUT_STATUS.ordinal());
			hmi.dataOut.writeInt(GuidanceAT.getCurrentStatus().ordinal());
			hmi.dataOut.flush();
			RConsole.println("Status data geflusht.");
			
			// getParkingSlots() returns null until it is implemented
			if (hmi.navigation.getParkingSlots() == null)
			{
				// do nothing
			}
			else
			{
				// write new parking slot - these are aperiodic information, thus should be sent as early as possible, 
				// but less important than status updates.
				//Iterate over complete array to determine number of parking slots that are not null
				
				int i = hmi.noOfParkingSlotsInList;
				while(i < hmi.navigation.getParkingSlots().length)
				{
					if(hmi.navigation.getParkingSlots()[i] != null)
					{
						i++;
					}
					else
					{
						hmi.noOfParkingSlotsInList = i;
						i = hmi.navigation.getParkingSlots().length;
					}
				}
				int newSlots = hmi.noOfParkingSlotsInList - hmi.noOfParkingSlots;

				hmi.noOfParkingSlots += newSlots; // Record new slots

				while (newSlots > 0) {

					ParkingSlot newSlot = hmi.navigation.getParkingSlots()[hmi.noOfParkingSlots - newSlots];
					//Check if parking slot is null
					if(newSlot != null)
					{
//						if(newSlot.getStatus() == slotWithGoodStatus.getStatus())
//						{
							hmi.dataOut.writeInt(Command.OUT_PARKSLOT.ordinal());
							hmi.dataOut.writeInt(newSlot.getStatus().ordinal());
							hmi.dataOut.writeInt(newSlot.getID());
							hmi.dataOut.writeFloat(newSlot.getFrontBoundaryPosition().x);
							hmi.dataOut.writeFloat(newSlot.getFrontBoundaryPosition().y);
							hmi.dataOut.writeFloat(newSlot.getBackBoundaryPosition().x);
							hmi.dataOut.writeFloat(newSlot.getBackBoundaryPosition().y);
							hmi.dataOut.flush();
//						}
					}
					newSlots--;
				}

			}

			// write position - this has least priority, no damage is caused when position is not delivered during one cycle.
			Pose pose = hmi.navigation.getPose();

			hmi.dataOut.writeInt(Command.OUT_POSITION.ordinal());			
			hmi.dataOut.writeFloat(pose.getX());			
			hmi.dataOut.writeFloat(pose.getY());	
			hmi.dataOut.writeFloat(pose.getHeading());
			
			// Distance sensor values in clockwise directions (front, right, back, left) in mm
			hmi.dataOut.writeDouble(hmi.perception.getFrontSensorDistance());
			hmi.dataOut.writeDouble(hmi.perception.getFrontSideSensorDistance());
			hmi.dataOut.writeDouble(hmi.perception.getBackSensorDistance());
			hmi.dataOut.writeDouble(hmi.perception.getBackSideSensorDistance());
			
			hmi.dataOut.flush();


		} catch (IOException e)
		{
			System.out.println("IO-Exception in processOutputs()");
		}
	}