Skip to content

Commit 2708bf1

Browse files
committed
(tm_mod_urdf) add xml declaration
1 parent 6647a40 commit 2708bf1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tm_mod_urdf/tm_mod_urdf/modify_urdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _gen_urdf(args=None):
188188
xyzs, rpys = xyzrpys_from_urdf_DH(udh)
189189
modify_urdf(root, xyzs, rpys, udh)
190190

191-
link_data = ET.tostring(root, encoding='UTF-8').decode('UTF-8')
191+
link_data = ET.tostring(root, encoding='UTF-8', xml_declaration=True).decode('UTF-8')
192192

193193
file_save = ''
194194
if overwrite:

tm_mod_urdf/tm_mod_urdf/modify_xacro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def _gen_xacro(args=None):
200200
xyzs, rpys = xyzrpys_from_urdf_DH(udh)
201201
modify_urdf(root, xyzs, rpys, udh, '${prefix}')
202202

203-
link_data = ET.tostring(root, encoding='UTF-8').decode('UTF-8')
203+
link_data = ET.tostring(root, encoding='UTF-8', xml_declaration=True).decode('UTF-8')
204204
link_data = link_data.replace('ns0', 'xacro')
205205
link_data = link_data.replace(link_head, '', 1)
206206
link_data = link_data.replace(link_start, link_tag, 1)

0 commit comments

Comments
 (0)