Skip to content

Commit 11138ce

Browse files
committed
test both marshaled xml's
1 parent d64dc0a commit 11138ce

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/test/java/mujoco/java/XMLtest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public void marshal() throws JAXBException, IOException, InterruptedException {
193193
}
194194

195195
@Test
196-
public void unmarshal() throws JAXBException {
196+
public void unmarshal() throws JAXBException, IOException, InterruptedException {
197197
String filename = "model/humanoid/humanoid.xml";
198198
File file = new File(filename);
199199
if (!file.exists()) {
@@ -205,7 +205,16 @@ public void unmarshal() throws JAXBException {
205205
String marshaled = MuJoCoXML.marshal(m);
206206

207207
System.out.println(marshaled);
208-
208+
MuJoCoModelManager mRuntime = new MuJoCoModelManager(marshaled);
209+
while (mRuntime.getCurrentSimulationTimeSeconds() < 1) {
210+
mRuntime.step();
211+
// sleep
212+
Thread.sleep(mRuntime.getTimestepMilliSeconds());
213+
for(String s:mRuntime.getBodyNames()) {
214+
//System.out.println("Body "+s+" pose "+mRuntime.getBodyPose(s));
215+
}
216+
}
217+
mRuntime.close();
209218
}
210219

211220
}

0 commit comments

Comments
 (0)