Remove mjDSBL_PASSIVE, split it into mjDSBL_SPRING and mjDSBL_DAMPING.

PiperOrigin-RevId: 800870384
Change-Id: I273e0ceec090901e2620febb67e57914928e94bb
This commit is contained in:
Yuval Tassa
2025-08-29 06:05:18 -07:00
committed by Copybara-Service
parent 0eea5d6dbd
commit b092563cab
39 changed files with 455 additions and 289 deletions
+17 -3
View File
@@ -523,12 +523,26 @@ from its default.
:at:`contact`: :at-val:`[disable, enable], "enable"`
This flag disables collision detection and all standard computations related to contact constraints.
.. _option-flag-passive:
.. _option-flag-spring:
:at:`passive`: :at-val:`[disable, enable], "enable"`
This flag disables the simulation of joint and tendon spring-dampers, fluid dynamics forces, and custom passive
:at:`spring`: :at-val:`[disable, enable], "enable"`
This flag disables passive joint and tendon springs. If passive :ref:`damper <option-flag-damper>` forces are
also disabled, *all* passive forces are disabled, including gravity compensation, fluid forces, forces computed by
the :ref:`mjcb_passive` callback, and forces computed by :ref:`plugins <exPlugin>` when passed the
:ref:`mjPLUGIN_PASSIVE<mjtPluginCapabilityBit>` capability flag.
, fluid dynamics forces, and custom passive
forces computed by the :ref:`mjcb_passive` callback. As a result, no passive forces are applied.
.. _option-flag-damper:
:at:`damping`: :at-val:`[disable, enable], "enable"`
This flag disables passive joint and tendon dampers. If passive :ref:`spring <option-flag-spring>` forces are also
disabled, *all* passive forces are disabled, including gravity compensation, fluid forces, forces computed by the
:ref:`mjcb_passive` callback, and forces computed by :ref:`plugins <exPlugin>` when passed the
:ref:`mjPLUGIN_PASSIVE<mjtPluginCapabilityBit>` capability flag.
.. _option-flag-gravity:
:at:`gravity`: :at-val:`[disable, enable], "enable"`
+5 -5
View File
@@ -31,15 +31,15 @@
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`constraint<option-flag-constraint>` | :ref:`equality<option-flag-equality>` | :ref:`frictionloss<option-flag-frictionloss>` | :ref:`limit<option-flag-limit>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`contact<option-flag-contact>` | :ref:`passive<option-flag-passive>` | :ref:`gravity<option-flag-gravity>` | :ref:`clampctrl<option-flag-clampctrl>` | |
| | | | :ref:`contact<option-flag-contact>` | :ref:`spring<option-flag-spring>` | :ref:`damper<option-flag-damper>` | :ref:`gravity<option-flag-gravity>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`warmstart<option-flag-warmstart>` | :ref:`filterparent<option-flag-filterparent>` | :ref:`actuation<option-flag-actuation>` | :ref:`refsafe<option-flag-refsafe>` | |
| | | | :ref:`clampctrl<option-flag-clampctrl>` | :ref:`warmstart<option-flag-warmstart>` | :ref:`filterparent<option-flag-filterparent>` | :ref:`actuation<option-flag-actuation>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`sensor<option-flag-sensor>` | :ref:`midphase<option-flag-midphase>` | :ref:`eulerdamp<option-flag-eulerdamp>` | :ref:`autoreset<option-flag-autoreset>` | |
| | | | :ref:`refsafe<option-flag-refsafe>` | :ref:`sensor<option-flag-sensor>` | :ref:`midphase<option-flag-midphase>` | :ref:`eulerdamp<option-flag-eulerdamp>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`nativeccd<option-flag-nativeccd>` | :ref:`island<option-flag-island>` | :ref:`override<option-flag-override>` | :ref:`energy<option-flag-energy>` | |
| | | | :ref:`autoreset<option-flag-autoreset>` | :ref:`nativeccd<option-flag-nativeccd>` | :ref:`island<option-flag-island>` | :ref:`override<option-flag-override>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`fwdinv<option-flag-fwdinv>` | :ref:`invdiscrete<option-flag-invdiscrete>` | :ref:`multiccd<option-flag-multiccd>` | | |
| | | | :ref:`energy<option-flag-energy>` | :ref:`fwdinv<option-flag-fwdinv>` | :ref:`invdiscrete<option-flag-invdiscrete>` | :ref:`multiccd<option-flag-multiccd>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mujoco |br| |L| | | .. table:: |
+10
View File
@@ -34,6 +34,16 @@ General
principled and well-defined. Since this change to RK4 is effectively a bug fix, migration to the previous behavior
is not provided.
- The ``mjDSBL_PASSIVE`` flag for disabling passive forces was removed and replaced by
:ref:`mjDSBL_SPRING<mjtDisableBit>` and :ref:`mjDSBL_DAMPER<mjtDisableBit>` with corresponding
:ref:`mjcf<option-flag-spring>` :ref:`attributes<option-flag-damper>`. Each flag disables only joint and tendon
springs or dampers, respectively. When both flags are set, *all* passive forces are disabled, including gravity
compensation, fluid forces, forces computed by the :ref:`mjcb_passive` callback, and forces computed by
:ref:`plugins <exPlugin>` when passed the :ref:`mjPLUGIN_PASSIVE<mjtPluginCapabilityBit>` capability flag. Setting
both flags recovers the behavior of the previous flag and is the migration path for existing code using
``mjDSBL_PASSIVE``.
.. admonition:: Breaking ABI changes
:class: attention
+15 -14
View File
@@ -452,21 +452,22 @@ typedef enum mjtDisableBit_ { // disable default feature bitflags
mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints
mjDSBL_LIMIT = 1<<3, // joint and tendon limit constraints
mjDSBL_CONTACT = 1<<4, // contact constraints
mjDSBL_PASSIVE = 1<<5, // passive forces
mjDSBL_GRAVITY = 1<<6, // gravitational forces
mjDSBL_CLAMPCTRL = 1<<7, // clamp control to specified range
mjDSBL_WARMSTART = 1<<8, // warmstart constraint solver
mjDSBL_FILTERPARENT = 1<<9, // remove collisions with parent body
mjDSBL_ACTUATION = 1<<10, // apply actuation forces
mjDSBL_REFSAFE = 1<<11, // integrator safety: make ref[0]>=2*timestep
mjDSBL_SENSOR = 1<<12, // sensors
mjDSBL_MIDPHASE = 1<<13, // mid-phase collision filtering
mjDSBL_EULERDAMP = 1<<14, // implicit integration of joint damping in Euler integrator
mjDSBL_AUTORESET = 1<<15, // automatic reset when numerical issues are detected
mjDSBL_NATIVECCD = 1<<16, // native convex collision detection
mjDSBL_ISLAND = 1<<17, // constraint island discovery
mjDSBL_SPRING = 1<<5, // passive spring forces
mjDSBL_DAMPER = 1<<6, // passive damping forces
mjDSBL_GRAVITY = 1<<7, // gravitational forces
mjDSBL_CLAMPCTRL = 1<<8, // clamp control to specified range
mjDSBL_WARMSTART = 1<<9, // warmstart constraint solver
mjDSBL_FILTERPARENT = 1<<10, // remove collisions with parent body
mjDSBL_ACTUATION = 1<<11, // apply actuation forces
mjDSBL_REFSAFE = 1<<12, // integrator safety: make ref[0]>=2*timestep
mjDSBL_SENSOR = 1<<13, // sensors
mjDSBL_MIDPHASE = 1<<14, // mid-phase collision filtering
mjDSBL_EULERDAMP = 1<<15, // implicit integration of joint damping in Euler integrator
mjDSBL_AUTORESET = 1<<16, // automatic reset when numerical issues are detected
mjDSBL_NATIVECCD = 1<<17, // native convex collision detection
mjDSBL_ISLAND = 1<<18, // constraint island discovery
mjNDISABLE = 18 // number of disable flags
mjNDISABLE = 19 // number of disable flags
} mjtDisableBit;
typedef enum mjtEnableBit_ { // enable optional feature bitflags
mjENBL_OVERRIDE = 1<<0, // override contact parameters