Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load exampleMaps.mat
- whos *Map*
- map = binaryOccupancyMap(simpleMap,2);
- show(map)
- robotRadius = 0.2;
- mapInflated = copy(map);
- inflate(mapInflated,robotRadius);
- show(mapInflated)
- prm = mobileRobotPRM;
- prm.Map = mapInflated;
- prm.NumNodes = 50;
- prm.ConnectionDistance = 5;
- startLocation = [2 1];
- endLocation = [12 10];
- path = findpath(prm, startLocation, endLocation)
- show(prm)
- while isempty(path)
- % No feasible path found yet, increase the number of nodes
- prm.NumNodes = prm.NumNodes + 10;
- % Use the |update| function to re-create the PRM roadmap with the changed
- % attribute
- update(prm);
- % Search for a feasible path with the updated PRM
- path = findpath(prm, startLocation, endLocation);
- end
- %%
- load exampleMaps.mat
- whos *Map*
- map = binaryOccupancyMap(simpleMap,2);
- show(map)
- robotRadius = 0.2;
- mapInflated = copy(map);
- inflate(mapInflated,robotRadius);
- show(mapInflated)
- prm = mobileRobotPRM;
- prm.Map = mapInflated;
- prm.NumNodes = 50;
- prm.ConnectionDistance = 5;
- show(mapInflated)
- prm.Map = mapInflated;
- prm.NumNodes = 20;
- prm.ConnectionDistance = 15;
- startLocation = [3 3];
- endLocation = [45 35];
- path = findpath(prm, startLocation, endLocation);
- while isempty(path)
- % No feasible path found yet, increase the number of nodes
- prm.NumNodes = prm.NumNodes + 10;
- % Use the |update| function to re-create the PRM roadmap with the changed
- % attribute
- update(prm);
- % Search for a feasible path with the updated PRM
- path = findpath(prm, startLocation, endLocation);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement