def convertYawToDegrees(yaw):
    """
    Converts a yaw which is -180 to 180 to a compass heading between 0 and 360
    Useful in particular for the yaw value that the NavX supplies
    :param yaw: Initial yaw between -180 and 180
    :return: Degrees 0 to 360
    """
    if yaw == 0.0:
        return 0.0
    if yaw > 0.0:
        return 360 % yaw
    if yaw < 0.0:
        yaw += 360
        return 360 % yaw
    return 0.0