Commit Graph

22 Commits

Author SHA1 Message Date
Sam Haves fc2237dad8 Merge branch 'main' into newton-schemas 2026-05-13 09:57:59 -04:00
Kyle Bayes 6cb6e5a93f Enable multiccd by default.
PiperOrigin-RevId: 902752921
Change-Id: I8e2085ff17db0ac0db1641b8837415c458e5eca4
2026-04-20 12:00:10 -07:00
Sam Haves f2461f9ce6 Modify mj_PLUGIN_LIB_INIT to support multiple plugins in the same compilation unit.
Previously on MSVC we used DllMain to register plugins, you cannot have multiple definitions of DllMain in a single unit so you would get errors if you tried to register two plugins. This modifies the implementation to insert a function pointer into the C runtime initialization instead.

PiperOrigin-RevId: 896612678
Change-Id: I07732147b955d741c836acff6da986db0e9b9eff
2026-04-08 11:35:16 -07:00
Andrew Kaufman 792f53c823 USD : Adopt newton-usd-schemas & deprecate MjcPhysics equivalents 2026-03-31 10:44:59 -07:00
Yuval Tassa efae9157a7 Polynomial stiffness and damping https://youtu.be/aKa3ZlEF9_Y
PiperOrigin-RevId: 884607673
Change-Id: If8088dbf37fed1055304778a7eb84dec52cba920
2026-03-16 13:25:25 -07:00
Copybara-Service 9362031644 Merge pull request #3112 from LouRohanNV:fixUsdEqualities
PiperOrigin-RevId: 880843178
Change-Id: I23e817364772abab6cea9a0b92f7681b1372c2db
2026-03-09 07:19:09 -07:00
Copybara-Service cc9a474ed8 Merge pull request #3148 from LouRohanNV:usd-visual-prim-mesh-inertia
PiperOrigin-RevId: 880822823
Change-Id: Ib1fe2e4b500f64f44e306eb6adacf8b1c5e39ceb
2026-03-09 06:22:17 -07:00
Lou Rohan a1bc4f219f Parse UsdPhysicsJoint enabled attr to set equality->active 2026-03-05 15:45:30 -06:00
Lou Rohan 42ee943ec5 Fix USD equality decoding
- handle when body0 or body1 are the default prim/world
- add site-based equalities to the constrainst list so they aren't skipped
- support connect constraints by checking for spherical joints
2026-03-05 13:31:32 -06:00
Copybara-Service fce504beea Merge pull request #3129 from LouRohanNV:UsdContactExcludes
PiperOrigin-RevId: 879028113
Change-Id: I8798761bf40a8e60ef9aba83337bcabd96813cb9
2026-03-05 06:15:59 -08:00
Sam Haves b25f8433fe Refactor USD connect and weld equality decoding to align with MuJoCo's relpose semantics.
The relpose in mujoco represents the anchor in body1 space and the relative orientation of body2 in body1 space. Previously we were computing it as the relative position of body2 from body1 space.

Further, we now properly account for the setting of strictly the anchor and not the relpos by setting localPos0 *only*.

PiperOrigin-RevId: 878506356
Change-Id: I83fc7e97cd1a891e17f0bb091f8950b581be0e01
2026-03-04 08:34:09 -08:00
Lou Rohan 1378ab6d58 Fix indentation 2026-03-04 09:55:59 -06:00
Lou Rohan b1908c475c Call ParseMjcPhysicsMeshCollisionAPI() on visual prims that have an inertia attribute 2026-03-03 15:13:23 -06:00
Lou Rohan e895820e24 Check for the UsdPhysicsFilteredPairsAPI in the body parsing function 2026-02-23 12:51:02 -06:00
Lou Rohan 4fe8f73e44 Add USD parsing for contact excludes
- Contact excludes use the UsdPhysicsFilteredPairsAPI schema. Body1 is the body with the schema, body2 is contained in the list of filtered targets within the schema.
2026-02-23 12:44:48 -06: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 f434578d30 USD decoder improvements: Support actuators targeting tendons and improve side site index handling.
Adds support for mjTRN_TENDON actuators in the USD decoder. Modifies the tendon path parsing to correctly handle side site indices, allowing -1 to signify no side site for a given path element.

PiperOrigin-RevId: 862755621
Change-Id: I18b13b160e3d1c27945d0972a69012d6307131e9
2026-01-29 08:51:02 -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