Skip to content

EinarUeland/Astar-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A* (Astar / A Star) search algorithm. Easy to use

Can handle any heigth and width of occupancy grid? YES

Possible to specify multiple goal nodes? YES

Fast and efficient? YES

Possible to specify connecting distance to other nodes? YES (in other words the algorithm is not restriced to 8-directions)

In the version 1.0 there are no nested functions, subfunctions, plotters, or any other mess in the actual pathfinder script. Version2 is a bit faster, but possibly a bit harder to understand.

DOI


Algorithm has simple inputs: An occupancy grid. A goal Matrix, the start node and preffered connecting distance. The zip file includes an example on the use of the script

The Connecting Distance determines the connections from each node to neighbooring cells. This means that the algorithm is not restriced to 4 or 8-directions (which often is the case in other implementations). In general a longer connecting distance require some more computation time.

See the following examples for Connecting Distance varying between 1, 4 and 8;

In the above example, the A-Star algorithm needed to explore most cells. Efficiency can be improved by using the 2-sided solver as seen here;

Multiple goal nodes can be specified. In the below example, there is 4 different goal cells.

An example of use of provided method is the use in Frontier Based Exploration where the "robot" search for the nearest unexplored cell:

See example video here

By modifying the weight map for traversing cells, one can penalize paths that are near objects, and generally create smoother paths:


This code was written for a project, which I have written a paper about: http:https://proceedings.asmedigitalcollection.asme.org/proceeding.aspx?articleid=2655682 This paper provides some more details on the code, and how it can be applied in a practical example. If you use the code for academic work/publishing I will appreciate if you could cite the above paper.