mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Element Nesting too Deep

Open tudorjnu opened this issue 3 years ago • 3 comments

How to ask for help

I am trying to implement a discretised form of a continuous robot which has n_bodies=100. For this purpose, I used a composite element (rope) which I further saved into an .xml using mujoco's function. Afterwards, I have added actuation within the last 10 links.

When trying to load the .xml back, I get an error of Error=XML_ELEMENT_DEPTH_EXCEEDED ErrorID=18 (0x12) Line number=494: Element nesting is too deep..

This happens when I am just exporting and importing the model back as well.

How should I approach this? Thank you!

tudorjnu avatar May 28 '22 20:05 tudorjnu

Oh wow. This looks like an issue at the tinyxml parser level. Let us investigate and get back to you...

yuvaltassa avatar May 28 '22 22:05 yuvaltassa

Ugh, yes it is. See here.

We'll see if we can fix this upstream or find some other workaround, but this is not something we can easily fix in our own code. I'll keep this open and report back when we have more info.

In the meantime, maybe you can reduce the number of bodies in the chain?

yuvaltassa avatar May 28 '22 22:05 yuvaltassa

Thank you very much @yuvaltassa!

That helped a lot! I managed to get away with 95 elements.

I was thinking maybe it will be a good feature to be able to attach sections of composite elements. For example one could make a section of 10 elements followed by another and so on...

This will allow defining different properties (i.e. stiffness) to different blocks, thus making the block act like a stiffer or more flexible block. This property might help in the modeling of continuum robots.

tudorjnu avatar May 29 '22 09:05 tudorjnu

The maximum depth in tinyxml has now been increased to 500.

quagla avatar Jan 16 '23 17:01 quagla