forked from 20chase/menge_gazebo_generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (24 loc) · 952 Bytes
/
main.py
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
#!/usr/bin/env python
import argparse
import subprocess
import os
parser = argparse.ArgumentParser()
parser.add_argument("path", help="path to the scenario XML file")
parser.add_argument("-r", "--resolution", default=0.4, type=float)
args = parser.parse_args()
scene_name = args.path.split('/')[-1][:-4]
cwd = os.getcwd()
input_dir = cwd + "/example/{}.xml".format(scene_name)
output_dir = cwd + "/output/" + scene_name
print("input_dir: ", input_dir)
print("output_dir: ", output_dir)
os.chdir("MengeFileGenerator")
os.system("python3 menge_generator.py {} -o {} -r {}".format(
input_dir, output_dir, args.resolution
))
os.chdir(cwd)
os.system("python3 world_generator.py --scene_name {} --plugin".format(
scene_name
))
# os.system("cp -r ./output/{0} ~/menge_ws/Menge/examples/scene".format(scene_name))
# os.system("cp ./output/{0}/{0}.world ~/menge_ws/src/menge_gazebo/menge_gazebo_worlds/worlds/{0}.world".format(scene_name))