140 likes | 276 Views
Dave Lattanzi’s Laplace Planner. Laplace Solution. Store node charges as a dictionary Originally used state variables and nodeList Find Laplace solution and store in new dictionary Not a continuously updated field. Path Finding. Search for neighbor with minimum charge difference
E N D
Laplace Solution • Store node charges as a dictionary • Originally used state variables and nodeList • Find Laplace solution and store in new dictionary • Not a continuously updated field
Path Finding • Search for neighbor with minimum charge difference • Store as a dictionary of previous nodes
Results • Numerical issues • What’s a good initial charge value? • What’s a good tolerance • Gets stuck at local minima (shouldn’t happen) • Can find path if initialized properly
LaPlace Implementation Ryan Keedy 5/4/2012
Algorithm • Average surrounding nodes • If using 4 nodes, measure distance, and only average adjacent node values one unit away • Average in 1.0 for each node short of expected • Store values in “state” variable • Color code the map according to values • Continue until the start node has been assigned a new value (non-initialized) • Create the path without complicated math • Simply work from the start, progressing along neighbors with the smallest calculated values
Decisions to be Made • How to initialize nodes • Any value below 1.0 will promote local minima • “Convergence” takes longer • 4 vs. 8 nodes • 8 nodes can propagate calculations faster along diagonals • By picking an arbitrary cutoff value, there are two possible bad outcomes • Everything was initialized at 1.0, and the averaging process hasn’t propagated to the start node • Other initialization value may result in local minima • One problem with stopping when the start node is reached is that path may not be as smooth or “optimized”
Liang-TIng Jiang Laplace Path Planner # Update value: mean of 8 neighbors def computeLaplacian(self): # Identify boundary and free nodes def FindBoundary(self): Initial value: Boundary: 1.0 Free: 0.5 Goal: 0.0 # Greedily follow the lowest value def FollowGradient(self, start, goal): # Visualize the Laplacian values as a grey map def GreyMap(self, drawList):
Laplace Planner – A Lewis • Assumes nodes neighboring walls are walls themselves • 500+ iterations of non-parallel computing • Walls – 10000 • Empty - 5000
Issues/Solutions? • Occasionally gets stuck • Try to minimize data thrown around • Change area of interest – grow from goal?
MatLab Solution a=imread('LittleMap.jpg','jpg');%Imports Image imshow(a) %Displaces map to be processed figure(1) map=rgb2gray(a); %Creates Matrix Map to be manipulated figure(2) Simple image to start with, Black=Wall White=Goal Gray= Area for paths
imshow(map) i=2; j=2; [I,J]=size(map) %% DIFFERENTIATION 1 while (i<I) while (j<J); Mapnew(i,j)=(map(i-1,j)+map(i+1,j)+map(i,j-1)+map(i,j+1))/4; j=j+1; end i=i+1; j=2; end i=2; j=2; %%DIFFERENTIATION 2 while (i<I-1) while (j<J-1); Mapnew1(i,j)=(Mapnew(i-1,j)+Mapnew(i+1,j)+Mapnew(i,j-1)+Mapnew(i,j+1))/4; j=j+1; end i=i+1; j=2; end
Current Results Contours plot shows great results around edges. Needs to continue to slop toward goal!!!