Add per-world actuator fields, dampratio resolution, setLengthRange#1177
Merged
adenzler-nvidia merged 4 commits intogoogle-deepmind:mainfrom Feb 23, 2026
Merged
Conversation
Promote actuator_cranklength, actuator_acc0, and actuator_lengthrange from 1D (nu,) to 2D (*, nu) batched arrays, matching the pattern used by all other expandable actuator fields. This enables per-world domain randomization of these fields. Add dampratio resolution to set_const_0: for position actuators where biasprm[2] > 0 (interpreted as dampratio), compute reflected mass from dof_M0 and actuator_moment, then convert to damping coefficient via biasprm[2] = -dampratio * 2 * sqrt(kp * mass). Matches MuJoCo C engine_setconst.c set0() behavior. Add set_length_range() for computing feasible actuator length ranges from joint/tendon limits scaled by gear, implemented as a Warp kernel. Fix put_data crash when nefc == 0 but efc_J buffer is pre-allocated (guard reshape with nefc > 0 check).
…actuator-fields # Conflicts: # mujoco_warp/_src/io.py
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
reviewed
Feb 23, 2026
thowell
approved these changes
Feb 23, 2026
This was referenced Feb 23, 2026
- Use BiasType.AFFINE enum instead of hardcoded 1 - Replace 1e-12 thresholds with MJ_MINVAL - Remove redundant damping formula comment - Move actuator_biasprm to outputs in _resolve_dampratio launch - Move set_length_range import to top of io_test.py - Simplify test XML by removing unnecessary body/geom/actuator names
…actuator-fields # Conflicts: # mujoco_warp/_src/io_test.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
actuator_cranklength,actuator_acc0, andactuator_lengthrangefrom 1D(nu,)to 2D(*, nu)batched arrays, enabling per-world domain randomizationset_const_0: computesdof_M0and converts positivebiasprm[2](dampratio) to damping coefficient, matching MuJoCo Cengine_setconst.c:set0()set_length_range()for computing feasible actuator length ranges from joint/tendon limits, implemented as a Warp kernelput_datacrash whennefc == 0with pre-allocatedefc_JbufferTest plan
test_set_const_actuator_acc0_per_world,test_set_const_dampratio,test_set_const_dampratio_explicit_kv,test_set_length_range_joint_limited,test_set_length_range_tendon_limited,test_domain_randomize_cranklength