-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunsim.m
47 lines (41 loc) · 1 KB
/
runsim.m
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
close all;
clear all;
clc;
addpath(genpath('./'));
% %% Plan path 1
% disp('Planning ...');
% map = load_map('maps/map1.txt', 0.1, 2, 0.25);
% start = {[0.0 -4.9 0.2]};
% stop = {[6.0 18.0-1 5.0]};
% % stop = {[6.0 18.0-6 3.0]};
% nquad = length(start);
% for qn = 1:nquad
% tic
% path{qn} = dijkstra(map, start{qn}, stop{qn}, true);
% toc
% end
% if nquad == 1
% plot_path(map, path{1});
% else
% % you could modify your plot_path to handle cell input for multiple robots
% end
%% Plan path 3
disp('Planning ...');
map = load_map('maps/map3.txt', 0.2, 0.5, 0.25);
start = {[0.0, 5, 5.0]};
stop = {[20, 5, 5]};
nquad = length(start);
for qn = 1:nquad
tic
path{qn} = dijkstra(map, start{qn}, stop{qn}, true);
toc
end
if nquad == 1
plot_path(map, path{1});
else
% you could modify your plot_path to handle cell input for multiple robots
end
%% Additional init script
init_script;
%% Run trajectory
trajectory = test_trajectory(start, stop, map, path, true); % with visualization