robotarium / robotarium-matlab-simulator

MATLAB simulator for the Robotarium!
MIT License
95 stars 53 forks source link

'limitrate' option for drawnow compatibility #7

Open dr-parker opened 7 years ago

dr-parker commented 7 years ago

Older versions of MATLAB (R2013a) do not recognize the "limitrate' option when using drawnow. This can be avoided when the following if condition is increased to allow for more vehicles.

if(this.number_of_agents <= 6)
     drawnow
else
     drawnow limitrate
end

Alternatively, the number of vehicles can be reduced to match the original if condition above, e.g. in the consensus_static demo, vehicles are randomly generated in function this = RobotariumBuilder() found in RobotariumBuilder.m which randomly generates between 2 and 15 vehicles.

function this = RobotariumBuilder()
     this.available_agents = randi(14) + 1; 
     this.number_of_agents = -1;
end