-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGenerateEnvironmentFiles.m
More file actions
33 lines (30 loc) · 1.11 KB
/
GenerateEnvironmentFiles.m
File metadata and controls
33 lines (30 loc) · 1.11 KB
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
clear
close all
clc
%% Parameter Setup
% Specify input network file (open drive .xodr file)
scenario_fldr = '../env/merge/';
opendrive_file = 'scenario.xodr';
opendrivePath = [scenario_fldr, opendrive_file];
% Specify network file
net_file = [ scenario_fldr,'network.net.xml'];
%% Generate network file using netedit
fprintf("Generating Network files ... \n")
% Define netconvert arguments
NET_ARGS = strcat(" --opendrive ",opendrivePath," -o ",net_file, " --offset.disable-normalization true --ramps.guess true");
% call netconvert
command = strcat('netconvert' ,NET_ARGS);
status = system(command,'-echo');
%% Open NETEDIT for network route creation
fprintf("Opening Netedit for demand configuration ... \n")
fprintf("Please create a route demand, this can be done using netedit, or manually. Please refer to SUMO documentation \n")
command = strcat("netedit " ,net_file);
% open netedit
status = system(command,'-echo');
% check if route file has been created
cd(scenario_fldr)
if isempty(dir('*.rou.xml'))
error('Route file with extension .rou.xml has not been found, please create route file.')
else
fprintf("Success \n")
end