Skip to content

Fix RL joint isolation and expose batched simulation controls - #635

Draft
acrlw wants to merge 1 commit into
DexForce:mainfrom
acrlw:enhance/rl-batch-controls
Draft

acrlw wants to merge 1 commit into
DexForce:mainfrom
acrlw:enhance/rl-batch-controls

Conversation

@acrlw

@acrlw acrlw commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR fixes active-joint list sharing between environments and exposes the root-velocity and scene-capacity controls needed for batched locomotion training.

Changes

  • Isolate active-joint lists. Creating a second environment through control_parts can change the first environment's joint list from [0, 2] to [0, 2, 0, 2]. EmbodiedEnv._setup_robot() now builds a fresh instance list on each setup and copies explicitly configured active_joint_ids.
  • Expose root-velocity writes. Push events calling Robot.set_root_velocity() previously raised AttributeError. Add Articulation.set_root_velocity(velocity, env_ids=None), inherited by Robot, and the corresponding view interface. The input is an (N, 6) tensor containing world-frame linear velocity followed by angular velocity. SceneArticulationView validates the shape, selects one batch for both writes, preserves row order, and leaves unselected environments unchanged.
  • Expose material reuse. Add DefaultPhysicsCfg.cache_material, defaulting to False, and forward it through to_dexsim_args(). Training configurations can enable DexSim's existing material reuse with physics_config: {cache_material: true} for the default physics backend.
  • Forward scene-node capacity. Add optional SimulationManagerCfg.scene_node_capacity and forward the training configuration through config_to_cfg() to WorldConfig.scene_node_capacity. None preserves the native default; an explicit value such as 262144 reaches World creation.

Public API usage, configuration documentation, and the affected project context are updated.

Dependencies: no new dependencies. The changes use existing DexSim batch and configuration APIs.

Validation

Validated on the combined branch based on main@7bc7271c, using Python 3.11 and a local RTX 5090 D v2:

Check Result
Object/view, joint-isolation, material-cache, and node-capacity tests 47 passed
Existing simulation-configuration tests 131 passed
Native root-velocity writes CPU and GPU runs: three instances each, selection [2, 0], zero maximum readback error, and finite values after three physics steps
Project context Registry check passed; 23 tests passed
API documentation coverage 2,069 exports; no missing entries
Formatting Black 26.3.1: all 1,042 Python files passed; git diff --check passed

Pending on this branch: 2,000-update training runs and a full Sphinx build.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • Documentation update

Screenshots

Not applicable; this PR changes simulation APIs and configuration.

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py), if applicable
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

@acrlw acrlw added bug Something isn't working enhancement New feature or request physics Things related to physics gym robot learning env and its related features rl Features related to reinforcement learning labels Sep 16, 2026
@acrlw
acrlw force-pushed the enhance/rl-batch-controls branch from 6b9ffbf to c502be1 Compare September 16, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request gym robot learning env and its related features physics Things related to physics rl Features related to reinforcement learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants