From 1881c2d88129ec7d7c6e6f11a122b5733c992d59 Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Mon, 6 Nov 2023 08:11:36 -0800 Subject: [PATCH] Improve sorting of samples in documentation. PiperOrigin-RevId: 579847239 Change-Id: I392cd87b9a3e5616fcb10657db4ac81a38e430ed --- doc/programming/samples.rst | 55 +++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/doc/programming/samples.rst b/doc/programming/samples.rst index 75763808..c62d6987 100644 --- a/doc/programming/samples.rst +++ b/doc/programming/samples.rst @@ -73,33 +73,6 @@ Where the command line arguments are `start /affinity `__ command on Windows (processor affinity cannot be specified through documented API means on macOS). -.. _saCompile: - -`compile `_ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This code sample evokes the built-in parser and compiler. It implements all possible model conversions from (MJCF, URDF, -MJB) format to (MJCF, MJB, TXT) format. Models saved as MJCF use a canonical subset of our format as described in the -:doc:`../modeling` chapter, and therefore MJCF-to-MJCF conversion will generally result in a different file. -The TXT format is a human-readable road-map to the model. It cannot be loaded by MuJoCo, but can be a very useful aid -during model development. It is in one-to-one correspondence with the compiled mjModel. Note also that one can use the -function :ref:`mj_printData` to create a text file which is in one-to-one correspondence -with mjData, although this is not done by the code sample. - -.. _saBasic: - -`basic `_ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This code sample is a minimal interactive simulator. The model file must be provided as command-line argument. It -opens an OpenGL window using the platform-independent GLFW library, and renders the simulation state at 60 fps while -advancing the simulation in real-time. Press Backspace to reset the simulation. The mouse can be used to control the -camera: left drag to rotate, right drag to translate in the vertical plane, shift right drag to translate in the -horizontal plane, scroll or middle drag to zoom. - -The :ref:`Visualization` programming guide below explains how visualization works. This code sample is a minimal -illustration of the concepts in that guide. - .. _saSimulate: `simulate `_ @@ -112,6 +85,7 @@ functionality. This code sample uses the native UI to render various controls, a illustration of how the new UI framework is intended to be used. Below is a screen-capture of ``simulate`` in action: .. youtube:: 0ORsj_E17B0 + :width: 95% :align: center Interaction is done with the mouse; built-in help with a summary of available commands is available by pressing the @@ -140,6 +114,33 @@ power settings, the OS may reduce the CPU frequency; this is because :ref:`simul the time in order to slow down to realtime. This results in inaccurate timings. To avoid this problem, change the Windows power plan so that the minimum processor state is 100%. +.. _saCompile: + +`compile `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This code sample evokes the built-in parser and compiler. It implements all possible model conversions from (MJCF, URDF, +MJB) format to (MJCF, MJB, TXT) format. Models saved as MJCF use a canonical subset of our format as described in the +:doc:`../modeling` chapter, and therefore MJCF-to-MJCF conversion will generally result in a different file. +The TXT format is a human-readable road-map to the model. It cannot be loaded by MuJoCo, but can be a very useful aid +during model development. It is in one-to-one correspondence with the compiled mjModel. Note also that one can use the +function :ref:`mj_printData` to create a text file which is in one-to-one correspondence +with mjData, although this is not done by the code sample. + +.. _saBasic: + +`basic `_ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This code sample is a minimal interactive simulator. The model file must be provided as command-line argument. It +opens an OpenGL window using the platform-independent GLFW library, and renders the simulation state at 60 fps while +advancing the simulation in real-time. Press Backspace to reset the simulation. The mouse can be used to control the +camera: left drag to rotate, right drag to translate in the vertical plane, shift right drag to translate in the +horizontal plane, scroll or middle drag to zoom. + +The :ref:`Visualization` programming guide below explains how visualization works. This code sample is a minimal +illustration of the concepts in that guide. + .. _saRecord: `record `_