Generated by mix ex_mujoco.gen from MuJoCo's own headers. Regenerating is
the only way to edit this page, and mix ex_mujoco.gen --check fails when it
disagrees with the headers.
Functions
| MuJoCo functions | 551 |
|---|---|
| bound 1:1 by the generator | 25 |
| bound by hand | 13 |
| not bound | 513 |
Bound by hand
These need a decision per call — an error buffer to allocate, an output array
whose length is the caller's business, a state signature, a GL context — so
they are written out in c_src/ex_mujoco_nif.cpp rather than generated.
13 of MuJoCo's functions are covered this way:
state_size/2 and data_state_size/2 are the same call, header_version/0
answers a constant in the header rather than a call, and the rendering
entries are this package's own questions rather than MuJoCo's (renderer_new/3
and renderer_render/4 name the two MuJoCo calls they rest on).
load_xml/1— the error is a caller-sized char buffer; here it is our buffer and an exceptionload_xml_string/1— a parsed spec has to be compiled and freed around the model, which is a lifetime questiondata/1— the data block belongs to a model, so the handle holds bothreset/1— the step surface is(data), because the handle carries its modelforward/1— same:ExMujoco.forward/1takes the data, not model and datastep/1— same:ExMujoco.step/1takes the datastate_size/2— paired with get_state and set_state, which share the signature's meaningget_state/2— writes into a buffer whose lengthstate_sizefixed; allocated hereset_state/3— reads a buffer whose lengthstate_sizefixed; checked heredata_state_size/2— the same count, asked of the dataput_stateis givencontact_force/2— writes six numbers into a caller's array; allocated hereversion/0— the library's own version, checked against the headers at load timeheader_version/0— the header's version, for the same checkrenderer_available/0— the question a caller asks before rendering; the answer is this package's own (is there an OpenGL context here), not one MuJoCo declaresrenderer_unavailable_reason/0— the sentencerenderer_available/0answers false with, so a caller can say why instead of only 'no'renderer_new/3— a render context uploads the model's meshes and textures into GL objects, so it is a resource that holds its model and needs an OpenGL context of this package's ownrenderer_render/4— one scene update and one draw per pass, answering this pass's bytes rather than a caller-sized buffer — the depth conversion and the vertical flip belong to the answer
Not bound
419 of the 513 take something a NIF cannot
honestly invent — a callback, a void*, an output array whose length nothing
states, a variadic argument list — and binding one means deciding that
question, one function at a time. The other 94 need a name in
c_src/manifest.exs and mix ex_mujoco.gen, and nothing else.
Both lists are below, under the heading MuJoCo's header gives each block of functions, so a reader can look where MuJoCo would put the answer.
A name in the manifest is the whole of it
- Components (13) —
mj_Euler,mj_RungeKutta,mj_compareFwdInv,mj_fwdAcceleration,mj_fwdActuation,mj_fwdConstraint,mj_fwdKinematics,mj_fwdPosition,mj_fwdVelocity,mj_implicit,mj_invConstraint,mj_invPosition,mj_invVelocity - Decompositions / Solvers (1) —
mju_bandDiag - Error and memory (4) —
mj_warning,mju_clearHandlers,mju_setLogConfig,mju_writeLog - Initialization (9) —
mj_deleteData,mj_deleteModel,mj_freeStack,mj_markStack,mj_resetCallbacks,mj_resetCtrl,mj_resetDataDebug,mj_setConst,mj_sizeModel - Main simulation (3) —
mj_forwardSkip,mj_inverse,mj_inverseSkip - Miscellaneous (17) —
mju_Halton,mju_clip,mju_isBad,mju_isZero,mju_max,mju_min,mju_muscleBias,mju_muscleDynamics,mju_muscleGain,mju_round,mju_sigmoid,mju_sign,mju_springDamper,mju_str2Type,mju_type2Str,mju_warningText,mju_writeNumBytes - No heading in the header (2) —
mj__freeStack,mj__markStack - OpenGL rendering (3) —
mjr_finish,mjr_getError,mjr_rectangle - Parse and compile (1) —
mj_freeLastXML - Plugins (3) —
mjp_archiveProviderCount,mjp_pluginCount,mjp_providerCount - Printing (6) —
mj_printData,mj_printFormattedData,mj_printFormattedModel,mj_printModel,mju_printMat,mju_printMatSparse - Sub components (11) —
mj_checkAcc,mj_checkPos,mj_checkVel,mj_comVel,mj_factorM,mj_island,mj_makeM,mj_maxContact,mj_passive,mj_rnePostConstraint,mj_subtreeVel - Support (11) —
mj_actuatorInputName,mj_copyState,mj_getPluginConfig,mj_initCtrlHistory,mj_initSensorHistory,mj_insideSite,mj_isPyramidal,mj_loadAllPluginLibraries,mj_loadPluginLibrary,mj_setKeyframe,mj_setTotalmass - Threads (1) —
mju_threadpool - Vector math (8) —
mju_L1,mju_dist3,mju_dot,mju_dot3,mju_mulVecMatVec,mju_norm,mju_norm3,mju_sum - Visualization (1) —
mjv_copyModel
What the wall is, by area
| MuJoCo's heading | functions |
|---|---|
| Vector math | 38 |
| Support | 27 |
| Element initialization | 25 |
| Element casting | 24 |
| OpenGL rendering | 23 |
| Find and get utilities | 22 |
| Initialization | 19 |
| Interaction | 18 |
| Non-tree elements | 18 |
| Plugins | 16 |
| Quaternions | 14 |
| Visualization | 14 |
| Error and memory | 13 |
| Spec utilities | 13 |
| Attribute setters | 12 |
| Parse and compile | 12 |
| Decompositions / Solvers | 11 |
| Set actuator parameters | 11 |
| Miscellaneous | 10 |
| Tree elements | 9 |
| Virtual file system | 9 |
| UI framework | 8 |
| Attribute getters | 7 |
| Ray casting | 7 |
| Resources | 7 |
| Assets | 6 |
| Asset cache | 5 |
| Derivatives | 4 |
| Sub components | 4 |
| Poses | 3 |
| Printing | 3 |
| Signed Distance Functions | 3 |
| Sparse math | 3 |
| Attachment | 1 |
Decisions worth naming:
mjSpec— building a model at run time (mjs_addBody and the rest) is v0.2; loading XML, from a path or from a string, is enough to run anything meanwhilemj_copyData— it answers the destination it was given, and a handle to a data block you already hold is not a useful answer; copying state isstate/2andput_state/3mj_printData, mj_printModel— they write into a buffer the caller sizes; a string-returning wrapper is a design decision, not a translationmjr_readPixels, mjv_updateScene, mjv_makeScene, mjr_setBuffer, mjv_defaultScene— the renderer's own plumbing:renderer_render/4calls them in MuJoCo's own order, and binding them one by one would offer a caller a way to break that order
Fields
| struct | scalars | arrays | not exposed |
|---|---|---|---|
mjModel | 101 | 484 | 10 |
mjData | 38 | 180 | 8 |
MuJoCo's own API reference describes each of them; the names and the units are MuJoCo's, and its documentation is the documentation for the field.
Enums
All 83 enums MuJoCo declares are generated into ExMujoco.Types
with the values resolved from the headers — including the ones C numbers
implicitly and the ones that are an OR of their siblings.