Open camieac opened 8 years ago
Created the module for A* in navigation and started the code. The next step is to communicate with the database to get sensor data. the Cell object has been created but does not yet contain all the aspects that will be included, mainly because I didn't read the bit about GPS location in the issue. on that note the the current code does not include the function that it will be called from, i.e. the given example. Some additions that i thought of are written as comments at the top of a_star_algorithm.py.
I have found a number of resources that you may find useful:
Tasks
The algorithm itself: You'll need an accessible function similar to this:
In order to find this square object you'll need some sort of mapping between GPS lat/long and squares. I've just made a
find_square()
function that searches through the 2D array of squares for a square that contains the lat and long that you passed in. This can be worked out using the width of the square and the gps location of the centre of the square.find_path(source, destination)
takes in the source square and the destination square and returns the array of points in the correct format to be passed tonavigation.followPath()
. This is where the actual A* algorithm will take place, infind_path(source, destination)
.When you commit your code it would be nice of you add #47 at the start to attach the commit to this issue.