-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateTasks.py
More file actions
28 lines (23 loc) · 922 Bytes
/
Copy pathcreateTasks.py
File metadata and controls
28 lines (23 loc) · 922 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
import os
import json
import TessNG
def main():
# FRAGMENT赛道下针对所有没有tess文件的测试场景批量生成tess文件
mode = 'CREATE_TESS'
config = {'tasks': None}
# SERAIL赛道下生成包含waypoints的赛题
mode = 'CREATE_WAYPOINTS'
config = {'task_num': 1, 'map': 'TJST_pure', 'start_lane':344, 'link_ids': [344,460,47,167,153,224,47,167,153,224,484]}
TessNG.run(mode, config, auto_run=False)
if mode == 'CREATE_TESS':
temp_file_path = './temp/create_failed.json'
if os.path.exists(temp_file_path):
with open(temp_file_path, 'r') as f:
failed_list = json.load(f)
for tess_path in failed_list:
if os.path.exists(tess_path):
os.remove(tess_path)
print(f"Remove {tess_path}")
os.remove(temp_file_path)
if __name__ == '__main__':
main()