Code Monkey home page Code Monkey logo

a-star-path-planner's Introduction

a-start-path-planner

Dependencies

  • Python 3.6 or higher
  • Numpy
  • OpenCV 3.4.2 or higher
  • time

Running

python3 a_star_kshitij_abhishek.py

The user will be asked to input the start and goal coordinates of the robot. See example below

Enter x coordinate of start point: 1180
Enter y coordinate of start point: 250
Enter x coordinate of goal point: 950
Enter y coordinate of goal point: 250
Enter the clearnance of the robot: 2
Enter the radius of the robot: 2
Enter the step size: 1

The code will generate a visualization of the path planning process and the final path. The visualization will be saved as a video in the current directory along with the final path as an image.

Example Test Cases

The following test cases have been provided for you.

Test Case 1

Starting Coordinates = 10, 400, 0

Goal Coordinates = 1180, 10, 30

Clearance = 2

Radius = 2

Step Size = 10

Time Taken: 512 seconds

A-Star Path Planner

Test Case 2

Starting Coordinates = 250, 50, 30

Goal Coordinates = 950, 250, 60

Clearance = 2

Radius = 2

Step Size = 5

Time Taken: 240 seconds

A-Star Path Planner

Test Case 3

Starting Coordinates = 1180, 250, 0

Goal Coordinates = 950, 250, 180

Clearance = 2

Radius = 2

Step Size = 1

Time Taken: 13 seconds

A-Star Path Planner

a-star-path-planner's People

Contributors

armgits avatar kshitijkarnawat avatar

Watchers

 avatar

Forkers

armgits

a-star-path-planner's Issues

Change Map dimensions

TODO:

  1. Change Map Dimensions
  2. Change Obstacle Sizes
  3. Change In-obstacles function to check for collisions with the walls.

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Steps to recreate issue:

Enter x coordinate of start point: 10
Enter y coordinate of start point: 10
Enter the start angle of the robot in multiples of 30deg(0 <= theta <= 360): 0
Enter x coordinate of goal point: 10
Enter y coordinate of goal point: 100
Enter the start angle of the robot in multiples of 30deg(0 <= theta <= 360): 0
Enter the step length of the robot (1 <= L <= 10): 1

Terminal Output:

Traceback (most recent call last):
File "a_star_kshitij_abhishek.py", line 420, in
main()
File "a_star_kshitij_abhishek.py", line 405, in main
explored_nodes, shortest_path = astar(L, start_point, goal_point)
File "a_star_kshitij_abhishek.py", line 318, in astar
if child_cost + cost_to_come < open_list_info[child.coord].cost_to_come:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

A* does not find a path for robot step sizes other than 1

This instance inputs a step value of 5 but it doesn't work for any value other than 1. The search stops halfway before exploring anything close to the goal node.

Steps to recreate issue:

Enter x coordinate of start point: 10
Enter y coordinate of start point: 10
Enter the start angle of the robot in multiples of 30deg(0 <= theta <= 360): 0
Enter x coordinate of goal point: 190
Enter y coordinate of goal point: 100
Enter the start angle of the robot in multiples of 30deg(0 <= theta <= 360): 0
Enter the step length of the robot (1 <= L <= 10): 5

Terminal Output:

No path found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.