fix_urdf.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 
4 import sys
5 from xml.dom.minidom import parse
6 import re
7 
8 def main(from_file, to_file):
9  root = parse(from_file)
10  # remove illegal link/join
11  # link .*_cb_link
12  # joint .*_cb
13  links = root.getElementsByTagName("link")
14  joints = root.getElementsByTagName("joint")
15  for link in links:
16  name = link.getAttribute("name")
17  if re.match(".*_cb_link$", name):
18  link.parentNode.removeChild(link)
19  for joint in joints:
20  name = joint.getAttribute("name")
21  if re.match(".*_cb$", name):
22  joint.parentNode.removeChild(joint)
23  with open(to_file, "w") as f:
24  f.write(root.toxml())
25 
26 
27 if __name__ == "__main__":
28  main(sys.argv[1], sys.argv[2])
def main(from_file, to_file)
Definition: fix_urdf.py:8


jsk_calibration
Author(s):
autogenerated on Fri May 14 2021 02:51:46