Code covered by the BSD License  

Highlights from
Massive Uniform Manipulation: Control Large Populations of Simple Robots with a Common Input Signal

image thumbnail
from Massive Uniform Manipulation: Control Large Populations of Simple Robots with a Common Input Signal by Aaron Becker
rearranges n robots controlled to move in unison {up, down, left, right} using 1 obstacle

posControlShapes(shape)
function BW = posControlShapes(shape)
% contains arrangements of binary images used by PosControl_universal
% program for position control to an arbitrary shape using 1 obstacle.
% returns a binary image
BW = 0;
switch shape
    case 'I'
    BW =([ 1 1 1;0 1 0;0 1 0;0 1 0; 1 1 1]);
    case 'A'
    BW =([ 0 1 0;1 0 1; 1 1 1; 1 0 1]);
    case 'simpleSmile'
    BW = flipud([1 0 0 0 1;
     0 0 0 0 0;
     0 0 0 0 0;
     0 0 1 0 0;
     0 0 0 0 0;
     1 0 0 0 1;
     0 1 1 1 0]);
    case 'Smile'
    BW = ([0 0 0 0 1 0 1 0 1 0 0 0 0;
     0 0 0 0 1 0 1 0 1 0 0 0 0;
     0 0 0 0 1 0 1 0 1 0 0 0 0;
     0 0 0 1 0 0 0 0 0 1 0 0 0;
     0 0 1 0 0 0 0 0 0 0 1 0 0;
     0 1 0 0 1 0 0 0 1 0 0 1 0;
     1 0 0 0 0 0 0 0 0 0 0 0 1;
     1 0 0 0 0 0 1 0 0 0 0 0 1;
     1 0 1 0 0 0 0 0 0 0 1 0 1;
     1 0 0 1 0 0 0 0 0 1 0 0 1;
     0 1 0 0 1 0 0 0 1 0 0 1 0;
     0 0 1 0 0 1 1 1 0 0 1 0 0;
     0 0 0 1 0 0 0 0 0 1 0 0 0;
     0 0 0 0 1 1 1 1 1 0 0 0 0;]);
    case 'MRSL'
    BW =  [1 1 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1;
 1 1 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1;
 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 0 0 0 0 0 1 1 0 1 1 0 0 0;
 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 0 0 0;
 1 1 1 1 0 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0;
 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 0;
 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 0];
    BW = flipud(BW);

    case 'MonaLisa10'
    [BW ,~] = BinaryImage('monalisa10.png', 0); %5 , 9
    BW = not(BW);
    case 'MonaLisa3'
    [BW ,~] = BinaryImage('MonaLisa3.png', 0); %5 , 9
    BW = not(BW);
    case 'MonaLisaBig'
    [BW ,~] = BinaryImage('MonaLisaBW.png', 0); %5 , 9
    BW = not(BW);
end

Contact us