Use vfs to create mjModel from MJCF's XML already stored in memory? #24
-
First of all, thanks a lot for making MuJoCo available for free and soon open source! To test MuJoCo, I tried to set up a proof of concept integration between MuJoCo and Ignition Gazebo, see gazebosim/gz-physics#299 for more details. While working on that, I had to generate a MJCF file on the file in memory via TinyXML2 . I then wanted to generate a Initially, I tought it would be great to have some way to obtain an
However, among the vfs function I could not find any that creates a vfs file from a string or buffer present already present in memory. Also the document common usage pattern seem to refer to loading file from the disk in the vfs, not load data that is already in memory in the vfs:
I wonder if I am missing something myself, thanks a lot in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I believe the correct workflow in this case is to create an empty VFS "file" using |
Beta Was this translation helpful? Give feedback.
-
Hello y'all... EntryPointNotFoundException: mj_makeEmptyFileVFS NullReferenceException: Failed to create Mujoco runtime. Do you by any chance have a suggestion that I'd need to follow? Thank you! |
Beta Was this translation helpful? Give feedback.
I believe the correct workflow in this case is to create an empty VFS "file" using
mj_makeEmptyFileVFS
with the appropriate size, and then copy the contents into the allocated memory space. Does that make sense?Note I've never tried this, so would love to hear if it works or not.