def METHOD_NAME(filename, start_file_path):
    if start_file_path is None or os.path.isabs(filename):
        return filename
    if not os.path.isabs(start_file_path):
        start_file_path = os.path.abspath(start_file_path)
    if start_file_path.split(".")[-1] in IMPORT_TYPES:
        start_file_path = os.path.dirname(start_file_path)  # /bla/blub/xyz/blib.xyz -> /bla/blub/xyz
    if filename.startswith("package://"):  # ROS Package
        if os.path.basename(start_file_path) in IMPORT_TYPES+["xacro"]:
            package_dir = os.path.dirname(start_file_path)  # /bla/blub/xyz -> /bla/blub
        else:
            raise IOError("Can't derive package_dir from " + start_file_path + ". "
                          "This usually happens when your URDF/SDF specifies the filepathes in the style "
                          "'package://${PACKAGE_NAME}/...' but your SDF/URDF is not correctly placed in the "
                          "urdf/sdf sub-directory of ${PACKAGE_NAME}.")
        out = os.path.join(package_dir, filename[len("package://"):].split("/", 1)[-1])
        assert os.path.exists(out), f"Couldn't identify file from {filename}. Tried {out} but it doesn't exist!"
    elif os.path.isabs(filename):
        out = filename
    else:  # normal urdf
        out = os.path.join(start_file_path, filename)
    return os.path.normpath(out)