Merge pull request #978 from aftersomemath:depth-precision-in-place

PiperOrigin-RevId: 572961667
Change-Id: I69011ddf835ae286e30e7f84cca67867cfe94fa4
This commit is contained in:
Copybara-Service
2023-10-12 11:18:36 -07:00
14 changed files with 194 additions and 34 deletions
+10
View File
@@ -502,6 +502,16 @@ These are the possible framebuffers. They are used as an argument to the functio
.. mujoco-include:: mjtFramebuffer
mjtDepthMap
~~~~~~~~~~~
These are the depth mapping options. They are used as a value for the ``readPixelDepth`` attribute of the
:ref:`mjrContext` struct, to control how the depth returned by :ref:`mjr_readPixels` is mapped from
``znear`` to ``zfar``.
.. mujoco-include:: mjtDepthMap
.. _mjtFontScale:
mjtFontScale
+12 -8
View File
@@ -131,15 +131,19 @@ General
22. Added multi-threaded constraint solving via :ref:`mj_island` and :ref:`mjThreadPool` to :ref:`testspeed<saTestspeed>`
exposed via npoolthread flag. The `22 humanoids <https://github.com/deepmind/mujoco/blob/main/model/humanoid/22_humanoids.xml>`__
model shows a 3x speedup compared to the single threaded simulation.
23. Implemented reversed Z rendering for better depth precision. An enum :ref:`mjtDepthMap` was added with values
:ref:`mjDEPTH_ZERONEAR` and :ref:`mjDEPTH_ZEROFAR`, which can be used to set the new ``readDepthMap`` attribute in
:ref:`mjrContext`` to control how the depth returned by :ref:`mjr_readPixels` is mapped from ``znear`` to ``zfar``.
`Contribution <https://github.com/google-deepmind/mujoco/pull/978>`__ by `Levi Burner <https://github.com/aftersomemath>`__.
Python bindings
^^^^^^^^^^^^^^^
23. Fixed `#870 <https://github.com/google-deepmind/mujoco/issues/870>`__ where calling ``update_scene`` with an invalid
24. Fixed `#870 <https://github.com/google-deepmind/mujoco/issues/870>`__ where calling ``update_scene`` with an invalid
camera name used the default camera.
24. Added ``user_scn`` to the :ref:`passive viewer<PyViewerPassive>` handle, which allows users to add custom
visualization geoms (`#1023 <https://github.com/google-deepmind/mujoco/issues/870>`__).
25. Added optional boolean keyword arguments ``show_left_ui`` and ``show_right_ui`` to the functions ``viewer.launch``
25. Added ``user_scn`` to the :ref:`passive viewer<PyViewerPassive>` handle, which allows users to add custom
visualization geoms (`#1023 <https://github.com/google-deepmind/mujoco/issues/870>`__).
26. Added optional boolean keyword arguments ``show_left_ui`` and ``show_right_ui`` to the functions ``viewer.launch``
and ``viewer.launch_passive``, which allow users to launch a viewer with UI panels hidden.
Simulate
@@ -149,21 +153,21 @@ Simulate
:align: right
:width: 240px
26. Added **state history** mechanism to :ref:`simulate<saSimulate>` and the managed
27. Added **state history** mechanism to :ref:`simulate<saSimulate>` and the managed
:ref:`Python viewer<PyViewerManaged>`. State history can be viewed by scrubbing the History slider and (more
precisely) with the left and right arrow keys. See screen capture:
27. The ``LOADING...`` label is now shown correctly.
28. The ``LOADING...`` label is now shown correctly.
`Contribution <https://github.com/google-deepmind/mujoco/pull/1070>`__ by
`Levi Burner <https://github.com/aftersomemath>`__.
Bug fixes
^^^^^^^^^
28. Fixed a bug that was causing :ref:`geom margin<body-geom-margin>` to be ignored during the construction of
29. Fixed a bug that was causing :ref:`geom margin<body-geom-margin>` to be ignored during the construction of
midphase collision trees.
29. Fixed a bug that was generating incorrect values in ``efc_diagApprox`` for weld equality constraints.
30. Fixed a bug that was generating incorrect values in ``efc_diagApprox`` for weld equality constraints.
Version 2.3.7 (July 20, 2023)
+7
View File
@@ -1443,6 +1443,10 @@ typedef enum mjtFramebuffer_ { // OpenGL framebuffer option
mjFB_WINDOW = 0, // default/window buffer
mjFB_OFFSCREEN // offscreen buffer
} mjtFramebuffer;
typedef enum mjtDepthMap_ { // depth mapping for `mjr_readPixels`
mjDEPTH_ZERONEAR = 0, // standard depth map; 0: znear, 1: zfar
mjDEPTH_ZEROFAR = 1 // reversed depth map; 1: znear, 0: zfar
} mjtDepthMap;
typedef enum mjtFontScale_ { // font scale, used at context creation
mjFONTSCALE_50 = 50, // 50% scale, suitable for low-res rendering
mjFONTSCALE_100 = 100, // normal scale, suitable in the absence of DPI scaling
@@ -1546,6 +1550,9 @@ struct mjrContext_ { // custom OpenGL context
// pixel output format
int readPixelFormat; // default color pixel format for mjr_readPixels
// depth output format
int readDepthMap; // depth mapping: mjDEPTH_ZERONEAR or mjDEPTH_ZEROFAR
};
typedef struct mjrContext_ mjrContext;
typedef enum mjtTaskStatus_ { // status values for mjTask