-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwrite-up .txt
61 lines (46 loc) · 3.08 KB
/
write-up .txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# how each rubric item was addressed, and specifically where in the code each step was handled
1 - reading the lon0, lat0 was done by actually looking at the first row of csv file and saving them as variable
' (lat0, lon0) = (37.792480, -122.397450)
global_home = (lon0, lat0, 0)
self.set_home_position(lon0, lat0, 0) '
2 - global_position was retrieved by using the udacidrone class methods and functions then saved as variable
' global_position = (self._longitude, self._latitude, self._altitude) '
after that, global_to_local function was used to convert to ECEF
3 - start point and goal point were hardcoded;
grid_start = (316, 316)
grid_goal = (750, 370)
4 - a_star algorithm was edited to add diagonal actions and corresponding costs as follows;
NORTH_EAST = (-1, 1, np.sqrt(2))
NORTH_WEST = (-1, -1, np.sqrt(2))
SOUTH_WEST = (1, -1, np.sqrt(2))
SOUTH_EAST = (1, 1, np.sqrt(2))
a_star was then ran and implemented to actually find the path we should traverse to reach goal
results ( path and cost ) was then saved as variables;
path, cost = a_star(grid, heuristic_func, grid_start, grid_goal
5 - waypoints have been culled using the collinearity algorithm by being ran on the resulted path from a_star.
pruned_path = prune_path(path)
6 - waypoints then have been sent to autopilot
# motion_planning.py against backyard_flyer_solution.py
The difference here between both of them is, in backyard_flyer we manually input the path vehicle takes;
we do not manually control the vehicle though. however in motion_planning, we just tell the vehicle
that we want to get from X1 to X2 and the vehicle does all the rest of job, using the planning utils
this is what we have now as the planning state, the state all of these utilities are ran at.
* The Create Grid function makes like a map, that our drone can understand and operate according to, without
this the drone doesn't really recognise the environment and surrounding.
* global_to_local function what we use to convert from coordinate systems the GPS and Sensors use
to the coordinate system the drone uses
* a_star function; after we have successfully created the grid, the map that our drone operates on, adding obstacles
and other neccessary environmental objects, this function plans and calculate the path we should traverse
to reach the goal we want.
* the plan path works as follows;
1 - set safety distance and target altitude
2 - load actual map data ( the csv file ..etc )
3 - retrieve global_home position and global_position
4 - convert to local position using global_to_local function
5 - create the grid containing the map data
6 - implement the a_star function which will plan the path and set of actions
needed to reach the goal
7 - implement the prune_path method, which reduces the waypoints;
waypoints are points along the path we traverse. without actually affecting
final result ( reaching the goal state )
8 - sends waypoints to the autopilot and start the transition phase