A Star search algorithm was predominantly used as a path planner for autonomous robots a while ago. It has some advantageous characteristics like finding the path with least cost. In this project we will be using A star algorithm to plan the path for a mobile robot in an environment with static variables.
Implement A* Algorithm to find a path between start and end point on a given map for a mobile robot. We need to make sure that no state is repeated so as to avoid infinite looping.
- A Star : A* is an informed search algorithm, or a best-first search, meaning that it is formulated in terms of weighted graphs starting from a specific starting node/state, it aims to find a path to the given goal node having the smallest cost (least distance travelled, shortest time, etc.).
- Action/Move Set : The Action/Move Set that the algorithm uses has 5 actions each having a Euclidean distance threshold of 0.5 unit and a theta threshold of 30 degrees for each action. Using these actions, the algorithm generates new states at every state and checks whether each new state is the required
goal state
. - Distance Metric : We are using the Euclidean Distance as the Metric which is the absolute distance between two points. It's being used with a threshold of 0.5 unit. Euclidean distance is used as a threshold to constraint the maximum extent of actions.
- Unique State Checker : We implement a set data structure to store all existing states. We will write an algorithm such that every unique state that is being entered into the set will be compared to all other existing states to avoid repitition.
├── Outputs │ └── images ├── LICENSE ├── README └── A-star_path_planner.py
- Clone the repository
git clone https://github.com/bharadwaj-chukkala/Path-Planning-for-a-point-robot-using-A-star-Search-Algorithm.git
- Install Python 3.9 and the libraries mentinoned below prior to running the code
- Go to the root directory from your IDE.
- Open the clonned project file in any IDE. (I used PyCharm)
- UnComment the line used for Visualization i.e. '309', which says- "plt.pause(0.00...1)"
- Run the Program
- In the Console, the program asks for:
- The Obstacle Clearance and Robot Radius
- Robot Step Size and
- The x and y coordinates of Start and Goal Node.
- Enter as prompted. example below
- Clearance: 5
- Robot Radius: 10
- Step size: 1
- Start: 50, 50
- Initial Theta: 30
- Goal: 150, 150
- Final Theta: 30.
- The Output Plot with planned Path should be Visible.
- NumPy
- argparse
- Matplotlib
- math
- heapq
- time
- The Robot movable space is shown in White Color
- The Pixels in Blue are the Obstacles.
- The Pixels in Cyan is the Clearance Space.
- The explored path is marked by Green color.
- The Planned Path is shown by Red Dotted Lines.
This project is licensed under the MIT License - see the LICENSE file for details.
Bharadwaj Chukkala
UID: 118341705
Bharadwaj Chukkala is currently a Master's student in Robotics at the University of Maryland, College Park, MD (Batch of 2023). His interests include Machine Learning, Perception and Path Planning for Autonomous Robots.