diff --git a/ragconnect.base/src/main/jastadd/mustache b/ragconnect.base/src/main/jastadd/mustache index 2bf869031ffc69bdb88dafd2cb4464a26502ae2b..130a96efa74f90c9d2f8634e2ddc6d6c705f146d 160000 --- a/ragconnect.base/src/main/jastadd/mustache +++ b/ragconnect.base/src/main/jastadd/mustache @@ -1 +1 @@ -Subproject commit 2bf869031ffc69bdb88dafd2cb4464a26502ae2b +Subproject commit 130a96efa74f90c9d2f8634e2ddc6d6c705f146d diff --git a/ragconnect.base/src/main/java/org/jastadd/ragconnect/compiler/SimpleMain.java b/ragconnect.base/src/main/java/org/jastadd/ragconnect/compiler/SimpleMain.java index b04e4776d3c23d7f11d1c49b237c4227e4c67b30..feb1596f0a85626bab4c0571c84ef2755ce0854e 100644 --- a/ragconnect.base/src/main/java/org/jastadd/ragconnect/compiler/SimpleMain.java +++ b/ragconnect.base/src/main/java/org/jastadd/ragconnect/compiler/SimpleMain.java @@ -17,8 +17,7 @@ public class SimpleMain { private static void printManualYAML() { Document doc = new Document(); - KeyValuePair root = new KeyValuePair(); - root.setKey("panda_mqtt_connector"); + MappingElement root = new MappingElement(); MappingElement firstLevel = new MappingElement(); firstLevel.addKeyValuePair(new KeyValuePair("server", new StringElement("tcp://localhost:1883"))); firstLevel.addKeyValuePair(new KeyValuePair("robot_speed_factor", new ValueElement(".7"))); @@ -34,19 +33,13 @@ public class SimpleMain { firstLevel.addKeyValuePair(new KeyValuePair("zone_size", new ValueElement("0.5"))); - KeyValuePair zones = new KeyValuePair(); - zones.setKey("zones"); ListElement theZones = new ListElement(); theZones.addElement(new StringElement("1 1")); theZones.addElement(new StringElement("0 1")); theZones.addElement(new StringElement("-1 1")); - zones.setValue(theZones); - firstLevel.addKeyValuePair(zones); + firstLevel.addKeyValuePair("zones", theZones); - KeyValuePair parts = new KeyValuePair(); - parts.setKey("end_effectors"); - KeyValuePair pandaParts = new KeyValuePair(); - pandaParts.setKey("panda"); + MappingElement pandaParts = new MappingElement(); MappingElement thePanda = new MappingElement(); thePanda.addKeyValuePair(new KeyValuePair("Link0", new StringElement("panda_link0"))); thePanda.addKeyValuePair(new KeyValuePair("Link1", new StringElement("panda_link1"))); @@ -57,17 +50,14 @@ public class SimpleMain { thePanda.addKeyValuePair(new KeyValuePair("Link6", new StringElement("panda_link6"))); thePanda.addKeyValuePair(new KeyValuePair("RightFinger", new StringElement("panda_rightfinger"))); thePanda.addKeyValuePair(new KeyValuePair("LeftFinger", new StringElement("panda_leftfinger"))); - pandaParts.setValue(thePanda); - parts.setValue(pandaParts); - firstLevel.addKeyValuePair(parts); + pandaParts.addKeyValuePair("panda", thePanda); + firstLevel.addKeyValuePair("parts", pandaParts); - KeyValuePair end_effectors = new KeyValuePair(); - end_effectors.setKey("end_effectors"); - KeyValuePair endEffectorParts = new KeyValuePair(); - endEffectorParts.setKey("panda"); - endEffectorParts.setValue(new KeyValuePair("EndEffector", new StringElement("panda_hand"))); - end_effectors.setValue(endEffectorParts); - firstLevel.addKeyValuePair(end_effectors); + MappingElement endEffectorParts = new MappingElement(); + MappingElement endEffector = new MappingElement(); + endEffector.addKeyValuePair("EndEffector", new StringElement("panda_hand")); + endEffectorParts.addKeyValuePair("panda", endEffector); + firstLevel.addKeyValuePair("end_effectors", endEffectorParts); KeyValuePair goalPoses = new KeyValuePair(); goalPoses.setKey("goal_poses"); @@ -81,7 +71,7 @@ public class SimpleMain { goalPoses.setValue(theGoalPoses); firstLevel.addKeyValuePair(goalPoses); - root.setValue(firstLevel); + root.addKeyValuePair("panda_mqtt_connector", firstLevel); doc.setRootElement(root); System.out.println(doc.prettyPrint());