forked from LazyFalcon/D_star_PathPlanning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResolvePath.m
More file actions
41 lines (32 loc) · 909 Bytes
/
ResolvePath.m
File metadata and controls
41 lines (32 loc) · 909 Bytes
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
function funOut = ResolvePath(state)
funOut = resolve();
function out = g(s) % 1 pozycja
out = state.graph(s(1), s(2),1);
end % 3 pozycja
function out = resolve()
s =state.goal;
out = [s];
state.graph(s(1), s(2),1) = inf;
uval = g(s);
minval = inf;
while ~isequal(s(1:2), state.start(1:2))
minval = inf;
it = [];
for n = state.ucc
u = s+n;
uval = g(u);
if uval < minval && ~isinf(uval) && uval > -1
minval = uval;
it = n;
end
end
if isempty(it)
fprintf('there is no valid path\n');
return
end
s = s + it;
state.graph(s(1), s(2),1) = inf;
out = [out, s];
end
end
end