From a32dd7dcdd8167187292a48f68a54a5cb36d6b24 Mon Sep 17 00:00:00 2001
From: timkondratiev <39171113+timkondratiev@users.noreply.github.com>
Date: Wed, 27 Jan 2021 16:01:59 +0300
Subject: [PATCH] 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.
---
clover_simulation/src/clover_simulation/world.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/clover_simulation/src/clover_simulation/world.py b/clover_simulation/src/clover_simulation/world.py
index 322a6d9e..20378c01 100644
--- a/clover_simulation/src/clover_simulation/world.py
+++ b/clover_simulation/src/clover_simulation/world.py
@@ -5,10 +5,10 @@ import xml.etree.ElementTree as ET
from string import Template
WORLD_INCLUDE = Template('''
-
- model://${model_name}
- ${x} ${y} ${z} ${roll} ${pitch} ${yaw}
-
+
+ model://${model_name}
+ ${x} ${y} ${z} ${roll} ${pitch} ${yaw}
+
''')
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