function floor_index = WP_find_floor_WP(indexes)
%

% dot of [-0.8222;0;-0.5691] and [0;0;1]
VDOT = -0.5691;
MAX_VDOT_DIF = 0.07;
XMAX = 0.1;
YMAX = -0.822;
PLANE_DIST = 0.82;   % meters
MAX_PLANE_DIST = 0.2;

floor_index = [];

if isempty(indexes)
    return
end

num_indexes = length(indexes);
for ind = 1:num_indexes
    plane = WP_beliefs(1,indexes(ind),'info',0);
    vdot = plane(3);
    if abs(vdot-VDOT)<MAX_VDOT_DIF&abs(plane(1))<XMAX & plane(2)<YMAX
        d = plane(4);
        if abs(d-PLANE_DIST)<MAX_PLANE_DIST
            floor_index = indexes(ind);
            return
        end
    end
end
