- Load the 2.5D map in the colliders.csv file describing the environment.
- Discretize the environment into a grid or graph representation.
- Define the start and goal locations.
- Perform a search using A* or other search algorithm.
- Use a collinearity test or ray tracing method (like Bresenham) to remove unnecessary waypoints.
- Return waypoints in local ECEF coordinates (format for
self.all_waypoints
is [N, E, altitude, heading], where the drone’s start location corresponds to [0, 0, 0, 0]. - Write it up.
- Congratulations! Your Done!
Rubric Points
Here I will consider the rubric points individually and describe how I addressed each point in my implementation.
1. Provide a Writeup / README that includes all the rubric points and how you addressed each one. You can submit your writeup as markdown or pdf.
You're reading it! Below I describe how I addressed each rubric point and where in my code each point is handled.
planning_utils contains the code needed to run A* on a grid representation of the environment. motion_planning contains most of the same movement logic as backyard_flyer, with the important addition of the planning state and the plan_path method. Currently, plan_path has a lot of the boilerplate code necessary, but sets the goal distance as 10 metres north and east of the current position. In the path created (which doesnt have to go through obstacles), it sets every path point as a waypoint and sends that path plan.
Here students should read the first line of the csv file, extract lat0 and lon0 as floating point values and use the self.set_home_position() method to set global home. Explain briefly how you accomplished this in your code.
I used open() and read the first line of the file, parsing the string into a lat,lon tuple
Here as long as you successfully determine your local position relative to global home you'll be all set. Explain briefly how you accomplished this in your code.
I called the global_to_local function
This is another step in adding flexibility to the start location. As long as it works you're good to go!
Simply added local position to the start point
This step is to add flexibility to the desired goal location. Should be able to choose any (lat, lon) within the map and have it rendered to a goal location on the grid.
I set a position roughly above Battery and clay, but these values are easily changed
Minimal requirement here is to modify the code in planning_utils() to update the A* implementation to include diagonal motions on the grid that have a cost of sqrt(2), but more creative solutions are welcome. Explain the code you used to accomplish this step.
I used a 2D Voronoi graph crunstructed based off the target altitude instead. In order to accomplish this, I pulled a lot of the code from the exercises and made minor modifications. The cost is the distance between points, and the provided A* algorithm is replaced with graph-based variant
For this step you can use a collinearity test or ray tracing method like Bresenham. The idea is simply to prune your path of unnecessary waypoints. Explain the code you used to accomplish this step.
This no longer necessary with a graph based search
It works!
Double check that you've met specifications for each of the rubric points.
For an extra challenge, consider implementing some of the techniques described in the "Real World Planning" lesson. You could try implementing a vehicle model to take dynamic constraints into account, or implement a replanning method to invoke if you get off course or encounter unexpected obstacles.