uorb_to_ros_msgs: delete all messages on the out dir first, so it can also consider message deletions on the input dir

This commit is contained in:
TSC21 2019-01-27 18:00:47 +00:00 committed by Lorenz Meier
parent 5c17a0b205
commit de917bae6d
1 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,12 @@ output_dir = sys.argv[2]
if not os.path.exists(os.path.abspath(output_dir)):
os.mkdir(os.path.abspath(output_dir))
else:
ros_msg_dir = os.path.abspath(output_dir)
msg_files = os.listdir(ros_msg_dir)
for msg in msg_files:
if msg.endswith(".msg"):
os.remove(os.path.join(ros_msg_dir, msg))
msg_list = list()