From 4ab274aea9bdbdbc9f02443c0d5d354b9f249b9e Mon Sep 17 00:00:00 2001 From: Google DeepMind Date: Sun, 26 Jan 2025 20:24:59 -0800 Subject: [PATCH] Fix missing arg for mj_compile in model-editing doc example code. PiperOrigin-RevId: 720005405 Change-Id: Idf71a1a12fe4cfcc450cd80c91b13ee8a75e1636 --- doc/programming/modeledit.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/programming/modeledit.rst b/doc/programming/modeledit.rst index fa800b67..9fa61790 100644 --- a/doc/programming/modeledit.rst +++ b/doc/programming/modeledit.rst @@ -49,7 +49,7 @@ editing corresponds to setting attributes. For example, in order to change the t mjSpec* spec = mj_makeSpec(); spec->opt.timestep = 0.01; ... - mjModel* model = mj_compile(spec); + mjModel* model = mj_compile(spec, NULL); Attributes which have variable length are C++ vectors and strings, :ref:`exposed to C as opaque types`. In C one uses the provided :ref:`getters` and :ref:`setters`: @@ -95,7 +95,7 @@ Elements cannot be created directly; they are returned to the user by the corres mjsGeom* my_geom = mjs_addGeom(world, NULL); // add a geom to the world my_geom->type = mjGEOM_BOX; // set geom type my_geom->size[0] = my_geom->size[1] = my_geom->size[2] = 0.5; // set box size - mjModel* model = mj_compile(spec); // compile to mjModel + mjModel* model = mj_compile(spec, NULL); // compile to mjModel The ``NULL`` second argument to :ref:`mjs_addGeom` is the optional default class pointer. When using defaults procedurally, default classes are passed in explicitly to element constructors. The global defaults of all elements