mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user