Skip to content

Support MJCF muscle actuators - #3752

Open
han-xudong wants to merge 1 commit into
newton-physics:mainfrom
han-xudong:feat/mjcf-muscle-actuator
Open

Support MJCF muscle actuators#3752
han-xudong wants to merge 1 commit into
newton-physics:mainfrom
han-xudong:feat/mjcf-muscle-actuator

Conversation

@han-xudong

Copy link
Copy Markdown
Contributor

Description

Import MJCF muscle actuator shortcuts, including inherited muscle dynamics and force-law parameters. The change preserves explicitly authored actuator lengthrange, expands the shortcut into dynprm, gainprm, and biasprm, and reconstructs it with MjsActuator.set_to_muscle() without introducing a separate Newton-native muscle model.

Closes #3751

Checklist

  • New or existing tests cover these changes
  • The documentation is up to date with these changes
  • CHANGELOG.md has been updated (if user-facing change)

Test plan

uv run --extra dev python -m unittest newton.tests.test_mujoco_general_actuators.TestMuJoCoMuscleActuators -v
uvx pre-commit run -a

All three focused tests pass on CPU. CUDA is unavailable locally. Tests compare authored and default parameter arrays plus activation, force, and joint motion over five MuJoCo steps.

New feature / API change

import newton

mjcf = """
<mujoco>
  <worldbody><body><joint name="slide" type="slide"/><geom type="sphere" size="0.1" mass="1"/></body></worldbody>
  <actuator><muscle joint="slide" lengthrange="0.5 1.5" force="5"/></actuator>
</mujoco>
"""
builder = newton.ModelBuilder()
builder.add_mjcf(mjcf, ctrl_direct=True)

Expand muscle shortcuts into native activation, gain, and bias parameters, preserve authored length ranges, and reconstruct them with MuJoCo's shortcut API. Compare defaults and dynamic behavior with native MuJoCo.
@han-xudong
han-xudong requested a deployment to external-pr-approval July 31, 2026 07:23 — with GitHub Actions Waiting
@han-xudong
han-xudong requested a deployment to external-pr-approval July 31, 2026 07:23 — with GitHub Actions Waiting
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@han-xudong, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: d97023b4-574f-4019-81c1-e8b4787217b8

📥 Commits

Reviewing files that changed from the base of the PR and between 0f97d2a and cf3292f.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • newton/_src/solvers/mujoco/solver_mujoco.py
  • newton/_src/utils/import_mjcf.py
  • newton/tests/test_mujoco_general_actuators.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Support MJCF muscle actuators

1 participant