%% Release Monte Carlo Localization Object
% Create a map and a Monte Carlo localization object.

map = robotics.BinaryOccupancyGrid(10,10,20);
mcl = robotics.MonteCarloLocalization(map);

%
% Create robot data for the range sensor and pose.

ranges = 10*ones(1,300);
ranges(1,130:170) = 1.0;
angles = linspace(-pi/2,pi/2,300);
odometryPose = [0 0 0];

%
% Initialize particles using step.

[isUpdated,estimatedPose,covariance] = step(mcl,odometryPose,ranges,angles);

%
% Release object to adjust nontunable properties.

release(mcl)

% Copyright 2012 The MathWorks, Inc.