Commit Graph

39 Commits

Author SHA1 Message Date
Sam Haves 39e4458806 Update USD support in MuJoCo to Newton USD schemas v0.4.0.
See changelog for more info.

PiperOrigin-RevId: 960284190
Change-Id: I89a84b1efbc22c89ee99db7436851ef27a325176
2026-08-06 07:17:39 -07:00
Copybara-Service 15cbc8fb55 Merge pull request #3156 from andrewkaufman:newton-schemas
PiperOrigin-RevId: 925328794
Change-Id: If45b8659ea9b88785660331bca5ee837ac172f67
2026-06-02 07:06:59 -07:00
Yuval Tassa ab0e0091d5 Standardize "DO NOT EDIT" comments in generated files.
PiperOrigin-RevId: 919718422
Change-Id: I2cba07d75d37d45f3f30b23d049c944b080248ad
2026-05-22 09:34:45 -07:00
Yuval Tassa a4e49f2dff Margin and gap redesign (breaking change)
PiperOrigin-RevId: 914329812
Change-Id: I905665e4c1965bdb8b90587e5b1277cfbfe5cce0
2026-05-12 09:43:43 -07:00
Sam Haves a501731089 Update multiccd default in mjcPhysics.
PiperOrigin-RevId: 911410939
Change-Id: Ia20b5be87f85c4662b71994dd824d90c6b98b3ed
2026-05-06 10:21:48 -07:00
Sam Haves e93a69ea01 Add MjcPhysicsEqualityConnectAPI to MjcPhysics for equality/connect parsing.
PiperOrigin-RevId: 867736241
Change-Id: I2d4e9abcb14280dcfbbf63ff5f888fb57350cfb6
2026-02-09 13:02:42 -08:00
Sam Haves c63ba211e5 Refactor MjcPhysics EqualityJointAPI polynomial coefficients.
The single array attribute `mjc:polycoef` has been replaced by five individual double attributes: `mjc:coef0`, `mjc:coef1`, `mjc:coef2`, `mjc:coef3`, and `mjc:coef4`.

PiperOrigin-RevId: 865947359
Change-Id: If9d14a77b0a06e5dc712eeadd6e9402411570706
2026-02-05 07:56:11 -08:00
Sam Haves 2582a83ac3 Add equalityJointAPI to mjcPhysics.
PiperOrigin-RevId: 860081702
Change-Id: Ifd961dcb2a8e0f5d885e9e9dadc0153b03cb5f4d
2026-01-23 06:28:29 -08:00
Sam Haves c08e1d9e6e Add MjcEqualityAPI as a base class for MuJoCo constraints and MjcEqualityWeldAPI for representing weld constraints.
This change introduces two new USD API schema:
* MjcEqualityAPI - base API for representing MuJoCo equality constraints in USD, this will typically be applied to joints such as UsdPhysicsFixedJoint.
* MjcEqualityWeldAPI - extends MjcEqualityAPI for MuJoCo's weld equality constraints with an attribute for torqueScale.

The usd_decoder is updated to parse UsdPhysicsFixedJoints and convert the new schema attributes into the appropriate mjsEquality data fields.

PiperOrigin-RevId: 856723634
Change-Id: I0982fd3168b643f8e91d87bb5ae5933e526b63a1
2026-01-15 10:44:27 -08:00
Sam Haves d816b38f4c mjcPhysics MjcTendon path now has an indices attribute to allow repeated sites in tendon path.
Since relationships in USD can only contain a single instance of a path, it was previously impossible to have a tendon path that visits the same wrap target more than once. This is a fairly common occurence when dealing with tendons that have pulleys.

With this change, if mjc:path:indices is not defined then the behaviour is as it was and the mjc:path is considered to be ordered. If it is authored then the parser will use the indices into mjc:path as the order. This mirrors other similar concepts in USD such as face vertex indices.

PiperOrigin-RevId: 856339887
Change-Id: I6b9503973de377acdb0689be168c16e4aa19b70b
2026-01-14 13:24:28 -08:00
Sam Haves a5dc57c0c3 Move OpenUSD parsing to usd_decoder
Add usd_decoder to mujoco/plugin.
  - Previously was src/experimental/usd/usd_to_mjspec.cc, now that same spec is returned by the plugin.

PiperOrigin-RevId: 854350962
Change-Id: Ia980190a557c50ce8197980922a2594b613859b4
2026-01-09 14:48:29 -08:00
Sam Haves 2935af23f0 Add MJAPI to Get/SetUsdPrimPathUserValue declarations.
PiperOrigin-RevId: 846745363
Change-Id: I31f0af0675578a3dd63db7c56d9258206e19471d
2025-12-19 08:31:26 -08:00
Sam Haves 7d7648f7ed Update UsdWriter to write any parts of MjSpec that are not from USD to the EditTarget.
This enables two workflows:
1) Users that parsed some other format into MjSpec, or built it programmatically can export animated USD easily with as minimal as possible interaction with USD.

2) Creating a spec from USD, then modifying the spec, should not cause a duplication of data when writing to USD.

PiperOrigin-RevId: 827627520
Change-Id: I02c8c14a18569547710e54f3704d52ac0bf70ce6
2025-11-03 13:29:46 -08:00
Sam Haves 160b9480f9 Add support for tendons to mjcPhysics.
PiperOrigin-RevId: 822230926
Change-Id: I232a9fbfb473186ac742d210458ff0221a561126
2025-10-21 12:30:12 -07:00
Sam Haves 09682ade4b Fix mjcPhysics island flag default.
PiperOrigin-RevId: 822088739
Change-Id: If3a87976dd319502160fd886a1823c12d72bebf1
2025-10-21 06:27:28 -07:00
Yuval Tassa 431f96572e Remove unused mjOption.apirate.
PiperOrigin-RevId: 815633571
Change-Id: Ib98f3eb2df47f96fa1fe6e987a3a0cd23a9479f6
2025-10-06 02:51:17 -07:00
Kyle Bayes eb96dd556c Reduce ccd_iterations from 50 to 35.
PiperOrigin-RevId: 808610578
Change-Id: I8755f9ba2902bf0805b7ded07ee6e048e404a31f
2025-09-18 09:16:52 -07:00
Yuval Tassa b092563cab Remove mjDSBL_PASSIVE, split it into mjDSBL_SPRING and mjDSBL_DAMPING.
PiperOrigin-RevId: 800870384
Change-Id: I273e0ceec090901e2620febb67e57914928e94bb
2025-08-29 06:06:28 -07:00
Yuval Tassa 643dc5bf4f Update USD schema formatting
PiperOrigin-RevId: 800018484
Change-Id: I7677cd099415af1271c7475d80a660653199b984
2025-08-27 07:02:50 -07:00
Sam Haves a04e0385e4 Add USD content type support in MJCF.
PiperOrigin-RevId: 788075561
Change-Id: If37cc254cab0411454de7663e0b3ff9f2b263281
2025-07-28 10:53:49 -07:00
Sam Haves 541c56b46f Create mjcPhysics ImageableAPI for visual, non physical visual entities.
PiperOrigin-RevId: 786366034
Change-Id: Ifb72d2daf8f5963bb7007dda1685da94b456ff41
2025-07-23 11:48:17 -07:00
Sam Haves 3cc8d7f58a Fix typo in mjcPhysics MjcMaterialAPI
PiperOrigin-RevId: 783750052
Change-Id: Ib829ae7ead7a33572e94ee0fe221da778b623f10
2025-07-16 07:31:09 -07:00
Sam Haves ac0701d582 Add mujoco compiler settings to MjcSceneAPI in mjcPhysics.
PiperOrigin-RevId: 783729333
Change-Id: Ic1c3e4fb47a901de4eebdc2e987d276f4202d9ed
2025-07-16 06:09:36 -07:00
Sam Haves cdf5bcb693 Add inheritrange attribute to mjcPhysics MjcActuator
PiperOrigin-RevId: 783363012
Change-Id: I7d0476aae70c3acc3ed4808a8741b7eb12948dba
2025-07-15 09:30:16 -07:00
Sam Haves e441868dad Add missing attributes to MjcCollisionAPI USD schema.
PiperOrigin-RevId: 783006362
Change-Id: I02d51190d62bb9460863025cd16360427afc70c4
2025-07-14 12:47:24 -07:00
Sam Haves 92bcbeb5d3 Add support for UsdPhysicsMaterialAPI and create MjcMaterialAPI for missing attributes.
PiperOrigin-RevId: 782942169
Change-Id: I344b5e47d1d63c9d4e50173cb6a96d0af177ec9e
2025-07-14 09:53:13 -07:00
Sam Haves 11e695b4c2 Rename MjcTransmission to MjcActuator in mjcPhysics schema.
PiperOrigin-RevId: 782352356
Change-Id: I4b74e3131b0fed925c506742c22038231f848909
2025-07-12 09:39:01 -07:00
Sam Haves 3473e4e451 Add group support to mjcPhysics equivalents for sites, geoms, actuators, and joints.
PiperOrigin-RevId: 781945497
Change-Id: I5c409f05e6bae33c181a51c273f260daea6004fc
2025-07-11 05:37:41 -07:00
Sam Haves fbea72d767 Remove MjcActuatorAPI in favor of typed MjcTransmission.
PiperOrigin-RevId: 781498554
Change-Id: Ib6ce5038645f6ca08638a9d316b0347dc121bc62
2025-07-10 05:58:58 -07:00
Sam Haves 7e57a6bc30 Add missing actuatorgroupdisable default to mjcPhysics schema.
PiperOrigin-RevId: 781487140
Change-Id: I7b0ff3a015e0c6b229e5409455a648f6d2399617
2025-07-10 05:15:27 -07:00
Sam Haves e7212d86bc Add maxhullvert attribute to mjcPhysics MeshCollisionAPI.
PiperOrigin-RevId: 781482346
Change-Id: I0d53f9ad99ac842629243b0375907b2f91bd3b61
2025-07-10 04:59:18 -07:00
Sam Haves 14972d2490 Add mj_loadUSD function. Change simulate to use that instead of manual spec compilation.
PiperOrigin-RevId: 780608874
Change-Id: I333238c756fe76b371518a7cdf9452b93da3540a
2025-07-08 10:04:08 -07:00
Sam Haves e507e31922 Fix schema naming in mjcPhysics to avoid collisions.
PiperOrigin-RevId: 780537076
Change-Id: I4ea24162ba20d6aae10207491f9aae2250808576
2025-07-08 06:27:30 -07:00
Sam Haves 1742ba510c Swap out apostrophe for single quote in mjcPhysics actuator lengthRange docs.
PiperOrigin-RevId: 780051495
Change-Id: Ib56a012ded364740564b879456a9e0570b5a0d7a
2025-07-07 04:27:49 -07:00
Robin Alazard 862436f9b3 Add JointAPI schema in mjcPhysics.
PiperOrigin-RevId: 778030981
Change-Id: I22a4bf2a550fb78e47bef0ff171b10ce5912887e
2025-07-01 07:22:05 -07:00
Sam Haves 106df98946 Create Keyframe schema in mjcPhysics.
PiperOrigin-RevId: 777568003
Change-Id: I036fd54e2926c138f9ca8de87040b263b8427df3
2025-06-30 07:48:48 -07:00
Sam Haves afc35451a0 Expose ability to go from USD stage to MjSpec.
PiperOrigin-RevId: 776184388
Change-Id: I0325b347c9896183d148a196897e1e5d0c4bbde2
2025-06-26 10:09:55 -07:00
Sam Haves 672746f509 Use brackets for USD schema code.
PiperOrigin-RevId: 776157077
Change-Id: Id8c55a98dc695348430a99ca59ec509a6db26403
2025-06-26 08:54:55 -07:00
Sam Haves 9089059517 Move headers from src/experimental/usd to include/experimental/usd
PiperOrigin-RevId: 775269423
Change-Id: Ifca6c3ead32b9fb3f02784ed38a9efae300be410
2025-06-24 09:33:26 -07:00