-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrrt.m
More file actions
42 lines (36 loc) · 913 Bytes
/
Copy pathrrt.m
File metadata and controls
42 lines (36 loc) · 913 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
42
clc
clear all
close all
K = inf;
switch(1)
case 1
loadfilepath = 'bouncingball';
case 2
loadfilepath = 'biped_simplified';
end
addpath(loadfilepath);
initialization;
addpath(genpath('patch'));
%% model parameters
AlgorithmInit;
% pn = 0.9;% biped example
pn = 0.5;% bouncing ball example
tic
for k = 1:K
n = rand;
if (n < pn)
x_rand = sampleInC(N);
[T, I_new, isextended, edge_map, reachedset, x_new, psi_new] = extend(T, x_rand, edge_map, reachedset, 0);
else
x_rand = sampleInD(N);
[T, I_new, isextended, edge_map, reachedset, x_new, psi_new] = extend(T, x_rand, edge_map, reachedset, 1);
end
if isextended && Xf(T.get(I_new))
t = toc
fprintf('Find the solution!\n')
motionplan = getmotionplan(T, I_new, edge_map);
postprocess;
return;
end
end
fprintf('Fail to find the solution!\n')