urdf格式化
import os
import xml.dom.minidom as minidom
urdf_path = "airbot_play_v3_gripper.urdf"
new_urdf_path = urdf_path.replace(".urdf", "_new.urdf")
xmlDoc = minidom.parse(urdf_path)
# Save the modified URDF file
if os.path.exists(new_urdf_path):
os.remove(new_urdf_path)
print("new_urdf_path = ", new_urdf_path)
with open(new_urdf_path, 'w') as fp:
xmlDoc.writexml(fp)