From ee8da5babe1f916cc12df824097f1978422b5f1a Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Mon, 18 Sep 2023 01:46:59 -0700 Subject: [PATCH] Fix indentation bugs in docs, improve attribute order in schema. PiperOrigin-RevId: 566230568 Change-Id: I0f536a2048d3e35d8ee510d86b6eba7a74c4e80a --- doc/XMLreference.rst | 42 +++++++++++++-------------- doc/XMLschema.rst | 56 ++++++++++++++++++------------------ src/xml/xml_native_reader.cc | 16 +++++------ 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/doc/XMLreference.rst b/doc/XMLreference.rst index fa2d63fe..0de9e1c3 100644 --- a/doc/XMLreference.rst +++ b/doc/XMLreference.rst @@ -1562,7 +1562,7 @@ The full list of processing steps applied by the compiler to each mesh is as fol .. _mesh-plugin: :el-prefix:`mesh/` |-| **plugin** (?) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +''''''''''''''''''''''''''''''''''''' Associate this mesh with an :ref:`engine plugin`. Either :at:`plugin` or :at:`instance` are required. @@ -2246,24 +2246,6 @@ defined. Its body name is automatically defined as "world". See :ref:`CUser`. -.. _body-plugin: - -:el-prefix:`body/` |-| **plugin** (?) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Associate this body with an :ref:`engine plugin`. Either :at:`plugin` or :at:`instance` are required. - -.. _body-plugin-plugin: - -:at:`plugin`: :at-val:`string, optional` - Plugin identifier, used for implicit plugin instantiation. - -.. _body-plugin-instance: - -:at:`instance`: :at-val:`string, optional` - Instance name, used for explicit plugin instantiation. - - .. _body-inertial: :el-prefix:`body/` |-| **inertial** (?) @@ -2898,7 +2880,7 @@ helps clarify the role of bodies and geoms in MuJoCo. .. _geom-plugin: :el-prefix:`geom/` |-| **plugin** (?) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +''''''''''''''''''''''''''''''''''''' Associate this geom with an :ref:`engine plugin`. Either :at:`plugin` or :at:`instance` are required. @@ -3200,6 +3182,24 @@ the direction specified by the dir attribute. It does not have a full spatial fr The specular color of the light. +.. _body-plugin: + +:el-prefix:`body/` |-| **plugin** (?) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Associate this body with an :ref:`engine plugin`. Either :at:`plugin` or :at:`instance` are required. + +.. _body-plugin-plugin: + +:at:`plugin`: :at-val:`string, optional` + Plugin identifier, used for implicit plugin instantiation. + +.. _body-plugin-instance: + +:at:`instance`: :at-val:`string, optional` + Instance name, used for explicit plugin instantiation. + + .. _body-composite: :el-prefix:`body/` |-| **composite** (*) @@ -3650,7 +3650,7 @@ handle where the composite object is attached. For other composite types this su .. _composite-plugin: :el-prefix:`composite/` |-| **plugin** (?) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +'''''''''''''''''''''''''''''''''''''''''' Associate this composite with an :ref:`engine plugin`. Either :at:`plugin` or :at:`instance` are required. diff --git a/doc/XMLschema.rst b/doc/XMLschema.rst index 6cc3590a..2a890c51 100644 --- a/doc/XMLschema.rst +++ b/doc/XMLschema.rst @@ -260,20 +260,6 @@ | | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |_| body |br| |_| |L| | | .. table:: | -| :ref:`plugin | \* | :class: mjcf-attributes | -| ` | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -| | | | :ref:`plugin` | :ref:`instance` | | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| |_2| plugin |br| |_2| |L| | | .. table:: | -| :ref:`config | \* | :class: mjcf-attributes | -| ` | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -| | | | :ref:`key` | :ref:`value` | | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| |_| body |br| |_| |L| | | .. table:: | | :ref:`inertial | ? | :class: mjcf-attributes | | ` | | | | | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | @@ -385,6 +371,20 @@ | | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |_| body |br| |_| |L| | | .. table:: | +| :ref:`plugin | \* | :class: mjcf-attributes | +| ` | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +| | | | :ref:`plugin` | :ref:`instance` | | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | ++------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| |_2| plugin |br| |_2| |L| | | .. table:: | +| :ref:`config | \* | :class: mjcf-attributes | +| ` | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +| | | | :ref:`key` | :ref:`value` | | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | ++------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| |_| body |br| |_| |L| | | .. table:: | | :ref:`composite | \* | :class: mjcf-attributes | | ` | | | | | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | @@ -398,20 +398,6 @@ | | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |_2| composite |br| |_2| |L| | | .. table:: | -| :ref:`plugin | \* | :class: mjcf-attributes | -| ` | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -| | | | :ref:`plugin` | :ref:`instance` | | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| |_3| plugin |br| |_3| |L| | | .. table:: | -| :ref:`config | \* | :class: mjcf-attributes | -| ` | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -| | | | :ref:`key` | :ref:`value` | | | | -| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | -+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| |_2| composite |br| |_2| |L| | | .. table:: | | :ref:`joint | \* | :class: mjcf-attributes | | ` | | | | | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | @@ -479,6 +465,20 @@ | | | | :ref:`coord` | | | | | | | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| |_2| composite |br| |_2| |L| | | .. table:: | +| :ref:`plugin | \* | :class: mjcf-attributes | +| ` | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +| | | | :ref:`plugin` | :ref:`instance` | | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | ++------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| |_3| plugin |br| |_3| |L| | | .. table:: | +| :ref:`config | \* | :class: mjcf-attributes | +| ` | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | +| | | | :ref:`key` | :ref:`value` | | | | +| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ | ++------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | mujoco |br| |L| | | *no attributes* | | :ref:`contact` | | | +------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/src/xml/xml_native_reader.cc b/src/xml/xml_native_reader.cc index 8e244550..2aba5f79 100644 --- a/src/xml/xml_native_reader.cc +++ b/src/xml/xml_native_reader.cc @@ -239,10 +239,6 @@ static const char* MJCF[nMJCF][mjXATTRNUM] = { {"body", "R", "11", "name", "childclass", "pos", "quat", "mocap", "axisangle", "xyaxes", "zaxis", "euler", "gravcomp", "user"}, {"<"}, - {"plugin", "*", "2", "plugin", "instance"}, - {"<"}, - {"config", "*", "2", "key", "value"}, - {">"}, {"inertial", "?", "9", "pos", "quat", "mass", "diaginertia", "axisangle", "xyaxes", "zaxis", "euler", "fullinertia"}, {"joint", "*", "23", "name", "class", "type", "group", "pos", "axis", @@ -270,14 +266,14 @@ static const char* MJCF[nMJCF][mjXATTRNUM] = { {"light", "*", "15", "name", "class", "directional", "castshadow", "active", "pos", "dir", "attenuation", "cutoff", "exponent", "ambient", "diffuse", "specular", "mode", "target"}, + {"plugin", "*", "2", "plugin", "instance"}, + {"<"}, + {"config", "*", "2", "key", "value"}, + {">"}, {"composite", "*", "13", "prefix", "type", "count", "spacing", "offset", "flatinertia", "solrefsmooth", "solimpsmooth", "vertex", "face", "initial", "curve", "size"}, {"<"}, - {"plugin", "*", "2", "plugin", "instance"}, - {"<"}, - {"config", "*", "2", "key", "value"}, - {">"}, {"joint", "*", "17", "kind", "group", "stiffness", "damping", "armature", "solreffix", "solimpfix", "type", "axis", "limited", "range", "margin", "solreflimit", "solimplimit", @@ -293,6 +289,10 @@ static const char* MJCF[nMJCF][mjXATTRNUM] = { "density", "solmix", "solref", "solimp", "margin", "gap"}, {"site", "?", "4", "group", "size", "material", "rgba"}, {"pin", "*", "1", "coord"}, + {"plugin", "*", "2", "plugin", "instance"}, + {"<"}, + {"config", "*", "2", "key", "value"}, + {">"}, {">"}, {">"},