-
Notifications
You must be signed in to change notification settings - Fork 1
/
note.txt
executable file
·84 lines (59 loc) · 3.03 KB
/
note.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
How to run my code:
Open the terrain_opt.m, load your terrain.mat file and replace path1.ini with your path file name in pathname='path1.ini';
Description for .m file
getProjectInput.m
%This function should be called getProjectInput and take a single
%input, the project file name, project.ini. It should have multiple outputs which are: TerrainFile, StartPoint,
%EndPoint, NumWayPoints, and WayPoints (if NumWayPoints is greater than zero). StartPoint and
%EndPoint should be a 1x2 or 2x1 vector. WayPoints should be a NumWayPoints x 2 or 2 x
%NumWayPoints matrix.
computepath.m
This function generate path without optimization.
compute_cost.m
This function computes cost for the path generated by computepath.m
optimizewithcost.m
This function give you all the output from descent.m and the cost for every iteration but it works for all the path.
descentwithcost.m
This function give you all the output from descent.m and the cost for every iteration but it only works for direct path.
descent.m
% Computes the optimal path (xp,yp) with height hp for a cost function
% of the form J = sum(distance*(1 + (2*g*C*h/V^2)^2) on a terrain.
% Inputs: xp and yp are the path. The gravitational constant (g), the constant
% (C), and velocity are (V) are needed to evaluate the gradient of the cost function.
% cg=0 is steepest descent and cg =1 is conjugate gradient. cycles is the number
% of optimization cycles to perform.
% Outputs: The optimal path (xp,yp) with height (hp) after cycles number of either conjugate
% gradient or steepest descent optimziation.
%
%Parameters
%
%astep: vary a from 0 to amax using this interval size
%amax: maximum displacement of any point during each optimization call
%dmax: The maximum horizontal distance between points. If d > dmax a point is added
% in between. Used in check_path_points.
%disp_cost: if set to true the cost after each optimization cycle is output to the
% screen
descentop.m
The modified descent to make dmax a variable.
boundary.m
This function achieve the goal that the rover is no longer allowed within 0.15 kilometers from any boundary.
block.m
This function make path to avoid circular region with xc,yc as the center of the circle and r as the radius.
calc_gradients.m
%calc_gradients: Calculates the x and y derivatives
% of a two-dimensional field f.
%Inputs: x,y are the one-dimensional grids, and f is the two-dimensional field.
%Outputs: dfdx and dfdy are the two-dimensional fields of the derivatives.
%
%Comments: This function uses the central difference approximation and Neuman BCs.
%preallocate
compute_cost.m
This function computes the cost for paths.
compute_costop.m
This function computes the cost for optimized paths.
computepath.m
This function compute path with the input from path files.
direct_path.m
This function calculates the direct path.
optimizewithcost.m
This function gives you optimized path and cost for every iteration.