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 functions551
bound 1:1 by the generator25
bound by hand13
not bound513

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 exception
  • load_xml_string/1 — a parsed spec has to be compiled and freed around the model, which is a lifetime question
  • data/1 — the data block belongs to a model, so the handle holds both
  • reset/1 — the step surface is (data), because the handle carries its model
  • forward/1 — same: ExMujoco.forward/1 takes the data, not model and data
  • step/1 — same: ExMujoco.step/1 takes the data
  • state_size/2 — paired with get_state and set_state, which share the signature's meaning
  • get_state/2 — writes into a buffer whose length state_size fixed; allocated here
  • set_state/3 — reads a buffer whose length state_size fixed; checked here
  • data_state_size/2 — the same count, asked of the data put_state is given
  • contact_force/2 — writes six numbers into a caller's array; allocated here
  • version/0 — the library's own version, checked against the headers at load time
  • header_version/0 — the header's version, for the same check
  • renderer_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 declares
  • renderer_unavailable_reason/0 — the sentence renderer_available/0 answers 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 own
  • renderer_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 headingfunctions
Vector math38
Support27
Element initialization25
Element casting24
OpenGL rendering23
Find and get utilities22
Initialization19
Interaction18
Non-tree elements18
Plugins16
Quaternions14
Visualization14
Error and memory13
Spec utilities13
Attribute setters12
Parse and compile12
Decompositions / Solvers11
Set actuator parameters11
Miscellaneous10
Tree elements9
Virtual file system9
UI framework8
Attribute getters7
Ray casting7
Resources7
Assets6
Asset cache5
Derivatives4
Sub components4
Poses3
Printing3
Signed Distance Functions3
Sparse math3
Attachment1

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 meanwhile
  • mj_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 is state/2 and put_state/3
  • mj_printData, mj_printModel — they write into a buffer the caller sizes; a string-returning wrapper is a design decision, not a translation
  • mjr_readPixels, mjv_updateScene, mjv_makeScene, mjr_setBuffer, mjv_defaultScene — the renderer's own plumbing: renderer_render/4 calls them in MuJoCo's own order, and binding them one by one would offer a caller a way to break that order

Fields

structscalarsarraysnot exposed
mjModel10148410
mjData381808

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.