Skip to content

Add articulation and robot joint limit APIs#359

Open
yuecideng wants to merge 7 commits into
mainfrom
feature/articulation-robot-joint-limits
Open

Add articulation and robot joint limit APIs#359
yuecideng wants to merge 7 commits into
mainfrom
feature/articulation-robot-joint-limits

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

This PR adds articulation-level joint position, velocity, and effort limit getters plus DexSim-backed setters, and exposes matching robot APIs with backward-compatible name handling and joint_ids support.

Motivation and context:

  • unify joint limit API naming between Robot and Articulation
  • add direct support for DexSim set_joint_limits, set_joint_velocity_limit, and set_joint_effort_limit
  • keep limit caches synchronized after drive updates and cover the behavior with regression tests

Dependencies: None.

Issue reference: N/A

Verification:

  • pytest tests/sim/objects/test_articulation.py tests/sim/objects/test_robot.py -q (62 passed)

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

Screenshots

N/A

Checklist

  • I have verified the modified files are formatted with black.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature works
  • Dependencies have been updated, if applicable.

Copilot AI review requested due to automatic review settings July 4, 2026 14:54
@yuecideng yuecideng added enhancement New feature or request dexsim Things related to dexsim robot Module related to robot labels Jul 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends EmbodiChain’s simulation object layer by adding articulation-level joint limit getters/setters (position/velocity/effort) with DexSim-backed writes, and exposes matching robot APIs that support both control-part (name) selection and explicit joint_ids filtering while preserving prior precedence behavior.

Changes:

  • Added Articulation.get_*_limits(...) and Articulation.set_*_limits(...) APIs with env_ids/joint_ids filtering, input shape coercion, and cache updates.
  • Updated Articulation.set_qpos(...) to clamp against per-environment joint position limits (instead of using a single env’s limits).
  • Added Robot limit getters/setters that support joint_ids, keep backward-compatible name precedence, and are covered by new regression tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/sim/objects/test_robot.py Adds regression tests validating Robot limit APIs for control parts, joint_ids, and setter precedence.
tests/sim/objects/test_articulation.py Adds comprehensive tests for limit getter/setter filtering, cache synchronization, failure behavior, and qpos clamping.
embodichain/lab/sim/objects/robot.py Introduces a shared joint-id resolution helper and adds Robot limit getters/setters delegating to Articulation.
embodichain/lab/sim/objects/articulation.py Implements limit caching in ArticulationData, adds limit getter/setter APIs, and updates clamping/cache sync behavior.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dexsim Things related to dexsim enhancement New feature or request robot Module related to robot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants