Add joint armature support for articulations#290
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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()andArticulation.get_joint_drive()to accept/return armature (6th drive component). - Add
JointDrivePropertiesCfg.armatureand 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]. |
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.
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:
dexsdk:...-py311image for Python 3.11 / updated DexSimType of change
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 addarmature.Changes
JointDrivePropertiesCfg.armature(scalar or per-joint dict)ArticulationData.joint_armature,default_joint_armature, USD readbackset_joint_drive(armature=...)/ extendedget_joint_drive()Robotparity;get_articulation_joint_driveobservation includesarmaturetest_articulation.py,test_observation_functors.pysim_articulation.mdTest plan
pytest tests/sim/objects/test_articulation.py(24 passed, condapy311)Checklist
black .command to format the code base.🤖 Generated with Claude Code
Made with Cursor