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 — so they are written
out in c_src/ex_mujoco_nif.cpp rather than generated.
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 check
Not bound
426 of MuJoCo's 551 functions 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
87
are expressible and simply not bound yet: a name in c_src/manifest.exs, and
mix ex_mujoco.gen.
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 translationmjrContext— offscreen rendering is v0.3 — it needs a GL context per platform (EGL, OSMesa, CGL, WGL) and owns a thread
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.