Skip to content

Add joint armature support for articulations#290

Merged
yuecideng merged 1 commit into
mainfrom
feat/articulation-armature
Jun 4, 2026
Merged

Add joint armature support for articulations#290
yuecideng merged 1 commit into
mainfrom
feat/articulation-armature

Conversation

@yuecideng
Copy link
Copy Markdown
Contributor

Description

This PR adds joint armature support to EmbodiChain articulations and robots, aligned with DexSim 0.4.1 (set_drive / get_drive / set_armature / get_armature).

DexSim now exposes armature as the 6th element of get_drive() (index 5). EmbodiChain wires this through config, runtime APIs, batched data, and observations so users can configure and query armature the same way as stiffness, damping, friction, etc.

Motivation: Armature adds reflected inertia in joint space, which is useful for stable PID control and more realistic joint dynamics (see DexSim 0.4.1 release notes).

Dependencies:

  • DexSim >= 0.4.1 (armature in articulation drive API)
  • CI workflow updated to dexsdk:...-py311 image for Python 3.11 / updated DexSim

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

API note

Articulation.get_joint_drive() now returns a 6-tuple (stiffness, damping, max_effort, max_velocity, friction, armature). Callers unpacking 5 values need to add armature.

Changes

  • JointDrivePropertiesCfg.armature (scalar or per-joint dict)
  • ArticulationData.joint_armature, default_joint_armature, USD readback
  • set_joint_drive(armature=...) / extended get_joint_drive()
  • Robot parity; get_articulation_joint_drive observation includes armature
  • Tests: test_articulation.py, test_observation_functors.py
  • Docs: sim_articulation.md

Test plan

  • pytest tests/sim/objects/test_articulation.py (24 passed, conda py311)

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

🤖 Generated with Claude Code

Made with Cursor

Expose DexSim 0.4.1 articulation armature via JointDrivePropertiesCfg,
Articulation/Robot drive APIs, and joint-drive observations. Extend
get_joint_drive to return armature and update CI image for py311 DexSim.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings June 4, 2026 03:47
@yuecideng yuecideng added enhancement New feature or request physics Things related to physics dexsim Things related to dexsim docs Improvements or additions to documentation object Simulation object assets gym robot learning env and its related features labels Jun 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds joint armature support across EmbodiChain’s articulation/robot drive APIs to match DexSim 0.4.1, and wires the new property through config, observations, tests, docs, and CI.

Changes:

  • Extend Articulation.set_joint_drive() and Articulation.get_joint_drive() to accept/return armature (6th drive component).
  • Add JointDrivePropertiesCfg.armature and propagate defaults through robots/articulations and the joint-drive observation functor.
  • Update tests and documentation to reflect the new 6-tuple drive API; update CI container image to a py311 variant.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
embodichain/lab/sim/objects/articulation.py Adds armature readback/defaults and extends joint drive set/get APIs to include armature.
embodichain/lab/sim/objects/robot.py Plumbs armature through robot set_joint_drive() and default drive initialization.
embodichain/lab/sim/cfg.py Adds JointDrivePropertiesCfg.armature configuration field and documentation.
embodichain/lab/gym/envs/managers/observations.py Extends the joint-drive observation output with an armature tensor (including zero fallback).
tests/sim/objects/test_articulation.py Updates articulation drive tests to handle the new 6-tuple return value.
tests/gym/envs/managers/test_observation_functors.py Updates mock articulation and assertions to include armature in observation outputs and caching tests.
docs/source/overview/sim/sim_articulation.md Documents armature as a drive property and updates get_joint_drive() return tuple.
.github/workflows/main.yml Switches CI container image to a -py311 variant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

max_velocity (torch.Tensor): The maximum velocity of the joint drive with shape (len(env_ids), len(joint_ids)).
friction (torch.Tensor): The joint friction coefficient with shape (len(env_ids), len(joint_ids)).
armature (torch.Tensor): The joint armature with shape (len(env_ids), len(joint_ids)).
drive_type (str, optional): The type of drive to apply. Defaults to "force".
Units depend on the joint model:

* For prismatic (linear) joints, the unit is mass [kg].
* For revolute (angular) joints, the unit is mass * scene_length^2 [kg-m^2].
@yuecideng yuecideng merged commit 70dfc53 into main Jun 4, 2026
7 checks passed
@yuecideng yuecideng deleted the feat/articulation-armature branch June 4, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dexsim Things related to dexsim docs Improvements or additions to documentation enhancement New feature or request gym robot learning env and its related features object Simulation object assets physics Things related to physics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants