File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11package org .mujoco ;
22
33import java .io .File ;
4+ import java .io .IOException ;
5+ import java .nio .file .Files ;
6+ import java .nio .file .Paths ;
47import java .util .HashMap ;
58import java .util .Set ;
69
@@ -31,6 +34,13 @@ public class MuJoCoModelManager {
3134 private boolean connected = false ;
3235 private HashMap <String , Double > setEfforts = new HashMap <String , Double >();
3336 private HashMap <String , Double > positions = new HashMap <String , Double >();
37+ public MuJoCoModelManager (String xml ) throws IOException {
38+ //File tempFile = File.createTempFile("mujoco-", ".xml");
39+ //tempFile.deleteOnExit();
40+ File tempFile = new File ("/tmp/mujocoxmlTEST.XML" );
41+ Files .write ( Paths .get (tempFile .getAbsolutePath ()), xml .getBytes ());
42+ loadFromFile (tempFile );
43+ }
3444
3545 public MuJoCoModelManager (File config ) {
3646 loadFromFile (config );
You can’t perform that action at this time.
0 commit comments