clc;clear;env=load('environment.mat');map=occupancyMap(env.emptyWorld);% Start and End goal pose start=[1,13,0];goal=[14,2,0];map.show();gridon;holdon;plot(start(1),start(2),'ro');plot(goal(1),goal(2),'mo');ss=stateSpaceSE2;ss.StateBounds=[map.XWorldLimits;map.YWorldLimits;[-pi,pi]];sv=validatorOccupancyMap(ss);sv.Map=map;sv.ValidationDistance=0.1;% Creating RRT* plannerplanner=plannerRRTStar(ss,sv);planner.MaxConnectionDistance=0.5;planner.MaxIterations=30000;[pthObj,solnInfo]=plan(planner,start,goal);holdon;size_state=size(pthObj.States)size_tree=size(solnInfo.TreeData)fori=1:size_treeplot(solnInfo.TreeData(i,1),solnInfo.TreeData(i,2),'.-');drawnowendplot(solnInfo.TreeData(:,1),solnInfo.TreeData(:,2),'.-');plot(pthObj.States(:,1),pthObj.States(:,2),'r-','LineWidth',2);