%% Create or Update PRM
% When using the mobileRobotPRM object and modifying properties, with each new function call, the object triggers the roadmap points and connections to be recalculated. Because recalculating the map can be computationally intensive, you can reuse the same roadmap by calling findpath with different starting and ending locations.
% Load the map, simpleMap, from a .mat file as a logical matrix and create an occupancy grid.

load('exampleMaps.mat')
map = binaryOccupancyMap(simpleMap,2);

%
% Create a roadmap. Your nodes and connections might look different due to the random placement of nodes.

prm = mobileRobotPRM(map,100);
show(prm)

%
% Call update or change a parameter to update the nodes and connections.

update(prm)
show(prm)

% The PRM algorithm recalculates the node placement and generates a new network of nodes.
%
% Copyright 2018 The MathWorks, Inc.