MuJoCo plugin API reference

API functions that mainly serve to inject MuJoCo XML code

simMujoco.composite
simMujoco.getCompositeInfo
simMujoco.injectXML
simMujoco.removeXML

simMujoco.composite

Description Adds or injects a composite to the MuJoCo world
Lua synopsis int injectionId=simMujoco.composite(string xml,map info)
Lua arguments
xml: the xml code corresponding to a composite object
info: additional information about the composite:
element: the name of the XML element where the composite XML should be injected. Can be empty if shapeHandle is not empty
shapeHandle: the handle of the shape where the composite XML should be injected. Can be empty if element is not empty
prefix: the composite prefix string. Make sure the prefix is unique, and possible derived from the related shape
type: the composite type: grid, rope, loop, cloth, box, cylinder or ellipsoid
count: the size of the composite
respondableMask: the composite respondable mask
grow: the amount the composite nodes should grow for visuals
callback: a callback function that is called when the MuJoCo world gets regenerated. This allows to adjust the composite code on-the-fly
Lua return values
injectionId: the id of the injection
Python synopsis int injectionId=simMujoco.composite(string xml,dict info)

simMujoco.getCompositeInfo

Description Retrieves data about a composite
Lua synopsis map info=simMujoco.getCompositeInfo(int injectionId,int what)
Lua arguments
injectionId: the injection ID returned by simMujoco.composite
what: the type of requested data:
0: the positions of the composite nodes
1: the poses of the composite nodes
2: the triangles to render the composite
3: the grown triangles to render the composite
Lua return values
info: the requested data
Python synopsis dict info=simMujoco.getCompositeInfo(int injectionId,int what)

simMujoco.injectXML

Description Adds or injects XML data into a MuJoCo world
Lua synopsis int injectionId=simMujoco.injectXML(string xml,string element/int shapeHandle,map info=nil)
Lua arguments
xml: the xml code to inject
element/shapeHandle: the name of the XML element or the handle of the shape where the XML code should be injected
info: additional information about the XML code:
callback: a callback function that is called when the MuJoCo world gets regenerated. This allows to adjust the XML code on-the-fly
Lua return values
injectionId: the id of the injection
Python synopsis int injectionId=simMujoco.injectXML(string xml,string element/int shapeHandle,dict info=None)

simMujoco.removeXML

Description Removes XML data from the MuJoCo world
Lua synopsis simMujoco.removeXML(int injectionId)
Lua arguments
injectionId: the injection ID returned by simMujoco.composite or simMujoco.injectXML
Lua return values
Python synopsis simMujoco.removeXML(int injectionId)