function plan = WP_plan_selection(intentions,plan_in,...
    percept,planes,WP_set)
%

persistent state

if isempty(state)
    state = 0;
end

% codes for options
AVOID_OBSTACLE = 1;
FIND_FLOOR = 2;
FIND_GRAVITY = 3;
SET_POSE = 4;
RESET_POSE = 5;
EXTEND_WP = 11;
COMBINE_WP = 12;
TERMINATE = 13;

MAX_POSE_UNCERTAINTY = 1;

plan = plan_in;

if plan_in==0&isempty(intentions)
    return
end

if plan_in==0
    plan = intentions(1);
end
return
