Closed juan-g-bonilla closed 1 day ago
Yes, these features are planned, but we have not gotten to them yet.
Thanks for bringing this to our attention! Leaving open until this is resolved.
Now added. Please let us know what other issues you encounter!
Is your feature request related to a problem? Please describe. I am working on using
mujoco
as the multi-body dynamics engine for a larger simulation software. The future release ofmjSpec
will be extremely useful for our use case, which is users loading some spec (XML, URDF, etc), the program reflecting on said spec, and modifying it as needed. For example, we have wrappers for mujoco actuators so that the force/torque they produce can be set through models in our software.We had a previous implementation working by reading and rewriting the original XML and reloading that (I know...), so an officially supported
mjSpec
wy will go a long way. I have been toying with the latest version inmain
, and while creating anmjSpec
from scratch seems to work great, it is difficult to introspect on existingmjSpec
. Particularly, I find it impossible to find and safely access existing elements using the API.Describe the solution you'd like I'd like methods to safely cast a
mjsElement*
to the specificmjsXYZ*
class:With these methods and the existing
mjs_firstChild
/mjs_nextChild
, one should be able to traverse the body tree and access/modify all elements contained in it.The other capability I'd like to see is a way to iterate over non-tree elements, like actuators or sensors.
Given that the API is a WIP, some of these features might be planned (or even already available, and I'm just not seeing them).
Thank you for all the good work on
mujoco
!