- 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_waypointsis [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.
The script added an extra state to the previous project: PLANNING. This is the stage in which we will calculate waypoints and use them to navigate through the city.
In plan_path() in the starter code, we initialize the home, start, and goal positions. Next, we creates a 2.5D grid based on colliders.csv; this is done in planning_utils.create_grid. Finally, we set a couple of waypoints that are found using planning_utils.a_star(). Because the starter code a_star method has no diagonal actions, the resulting path is a zigzaggy path from start to goal.
Global home position is extracted from colliders.csv by reading the first line, splitting by ",", then spltting by " ". The resulting numbers are used to passed to self.set_home_position()
The local position is found by calculating the offset of the drone's global positon against the global home position. The method frame_utils.global_to_local is already provided and used.
The grid start position is calculated by the difference between the local position and the north-eastern corner of the grid.
The grid goal is calculated by 1) converting an arbitrary lat lon into local coordinates and 2) converting the local coordinates into grid coordinates.
4 actions - north east, north west, south east, and south west were added to the valid actions with cost sqrt(2). This was enough for the provided A* algorithm to support diagonal motion.
To cull waypoints, I used a collinearity test to remove unnecessary waypoints in between. This is not perfect, however, as certain paths that have many zigzag patterns are not collinear and thus not simplified.
It works! See motion_planning.mov for sample run.

