diff --git a/doc/mjwarp/index.rst b/doc/mjwarp/index.rst index 4565a431..0cd95133 100644 --- a/doc/mjwarp/index.rst +++ b/doc/mjwarp/index.rst @@ -668,3 +668,66 @@ Cholesky factorization `wp.tile_cholesky `__ and the result is not expected to match MuJoCo's corresponding field because a different reverse-mode ``L'DL`` routine :ref:`mj_factorM` is utilized. + +Options +------- + +:class:`mjw.Option ` fields correspond to their :ref:`mjOption` counterparts with the following +exceptions: + +- :ref:`impratio ` is stored as its inverse square root ``impratio_invsqrt``. +- The constraint solver setting :ref:`tolerance ` is clamped to a minimum value of ``1e-6``. +- Contact :ref:`override ` parameters :ref:`o_margin `, + :ref:`o_solref `, :ref:`o_solimp `, and :ref:`o_friction ` are + not available. + +:ref:`disableflags ` has the following differences: + +- :ref:`mjDSBL_MIDPHASE ` is not available. +- :ref:`mjDSBL_AUTORESET ` is not available. +- :ref:`mjDSBL_NATIVECCD ` changes the default box-box collider from CCD to a primitive collider. +- :ref:`mjDSBL_ISLAND ` is not currently available. Constraint island discovery is tracked in GitHub issue + `#886 `__. + +:ref:`enableflags ` has the following differences: + +- :ref:`mjENBL_OVERRIDE ` is not available. +- :ref:`mjENBL_FWDINV ` is not available. +- Constraint island sleeping enabled via :ref:`mjENBL_ISLAND ` is not currently available. This feature is + tracked in GitHub issues `#886 `__ and + `#887 `__. + +Additional MJWarp-only options are available: + +- ``is_sparse``: use sparse representation +- ``ls_parallel``: use parallel linesearch with the constraint solver +- ``ls_parallel_min_step``: minimum step size for the parallel linesearch +- ``has_fluid``: scene has non-zero wind, density, or viscosity at ``put_model`` time; if true, compute and apply fluid + forces and torques +- ``broadphase``: type of broadphase algorithm (:class:`mjw.BroadphaseType `) +- ``broadphase_filter``: type of filtering utilized by broadphase + (:class:`mjw.BroadphaseFilter `) +- ``graph_conditional``: use CUDA graph conditional +- ``run_collision_detection``: use collision detection routine +- ``contact_sensor_maxmatch``: maximum number of contacts for contact sensor matching criteria + +Unlike MuJoCo where all :ref:`mjOption` fields are configurable at runtime, the following +:class:`mjw.Option ` fields should not be directly modified: + +- ``density``: may require updating ``has_fluid`` +- ``viscosity``: may require updating ``has_fluid`` +- ``wind``: may require updating ``has_fluid`` +- ``is_sparse``: this field should not be set directly, instead modify the :ref:`mjOption` field + :ref:`jacobian ` + +These fields should be updated as recommended above or by modifying an :ref:`mjModel` instance that is utilized to +construct new :class:`mjw.Model ` and :class:`mjw.Data ` instances with +:func:`mjw.put_model ` and :func:`mjw.make_data ` / +:func:`mjw.put_data `. Directly modifying these fields at runtime may lead to unintended side +effects. + +.. admonition:: Graph capture + :class: note + + A new :ref:`graph capture ` may be necessary after modifying an :class:`mjw.Option ` field + in order for the updated setting to take effect.