function poly = growing_poly(required_positions, world_A, world_b, obstacle_pts, goal)
addpath iris-distro-master/src/matlab/
addpath 'c:/Program Files/Mosek/8/toolbox/r2014a'
import  iris-distro-master.src.matlab.iris.inflate_region.*;
import iris.inflate_region;
import iris.drawing.*;

f0 = mean(required_positions, 2);
lam = 1.0;
for i=1:35
    % Move starting point towards centroid
    start = lam*goal + (1 - lam)*f0;
    
    % Generate region grown from starting point
    [A,b,C,d,results] = inflate_region(obstacle_pts, world_A, world_b, start, 'require_containment', true);
    poly(1).A = A;
    poly(1).b = b;
    poly(1).C = C;
    poly(1).d = d;
    poly(1).results = results;
    poly(1).succ = 0;
    
    % Check that all required points are contained
    pass = all(all(A*required_positions <= b)) & A*start <= b;
    if pass
        poly(1).succ = 1;
        return
    end
    
    lam = lam * 0.9;
end

display('Fallback: growing poly from start f0=centroid');
[A,b,C,d,results] = inflate_region(obstacle_pts, world_A, world_b, f0, 'require_containment', true);
poly(1).A = A;
poly(1).b = b;
poly(1).C = C;
poly(1).d = d;
poly(1).results = results;
poly(1).succ = 0;

end
