-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.m
39 lines (32 loc) · 1.19 KB
/
Main.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
clc; clear all; close all;
%% 添加路径
current_folder = pwd;
addpath(genpath(current_folder));
%% 生成测试场景
scenarios = Scenario();
for scenario = scenarios
%% 生成规划边界
boundary_generator = GenerateBoundary(scenario);
boundaries = boundary_generator.GetBoundary();
% region = PlotEnvironment(scenario);
PlotBoundaries(boundaries);
%% 生成规划模型线性化的初始参考值
linearization_reference = GenerateInitLinearizationReference(scenario.lane);
%% 生成规划器并求解
tic;
planner = SQPPlanner(scenario.lane, boundaries, linearization_reference);
is_succeed = planner.SolveSQPProblem();
toc;
disp(['运行时间: ',num2str(toc)]);
if is_succeed
path = planner.GetPlannedPath();
sl_path = planner.GetPlannedSLPath();
iter_paths = planner.GetIterPlannedPath();
disp(strcat(scenario.name, ' PathPlan Succeed!'));
%% 制图
MakePathPlanGif(scenario, boundaries, path, sl_path, iter_paths, current_folder);
else
disp(strcat(scenario.name, ' PathPlan Failed!'));
end
disp('<=================================================>');
end