clover_simulation: fix XML formatting in generated world (#299)

Changed the way of adding an XML element into the .world file to fix the formatting issue.
This commit is contained in:
timkondratiev
2021-01-27 16:01:59 +03:00
committed by GitHub
parent 1e12e34070
commit a32dd7dcdd

View File

@@ -5,10 +5,10 @@ import xml.etree.ElementTree as ET
from string import Template
WORLD_INCLUDE = Template('''
<include>
<uri>model://${model_name}</uri>
<pose>${x} ${y} ${z} ${roll} ${pitch} ${yaw}</pose>
</include>
<include>
<uri>model://${model_name}</uri>
<pose>${x} ${y} ${z} ${roll} ${pitch} ${yaw}</pose>
</include>
''')
def load_world(world_file):
@@ -32,6 +32,7 @@ def add_model(world, model_name, x, y, z, roll, pitch, yaw, index=0):
pitch=pitch,
yaw=yaw
))
model_elem.tail = '\n '
world_elem.insert(index, model_elem)
return world