Commit Graph

2922 Commits

Author SHA1 Message Date
Kyle Bayes 9e72874801 Remove EPA tolerance in the discrete case in nativeccd.
PiperOrigin-RevId: 750649926
Change-Id: I8ab317cd6b227c9486a2916ae9c6445906c23401
2025-04-23 10:52:14 -07:00
Yuval Tassa 8f768be2da Remove solver_nisland field from mjData.
PiperOrigin-RevId: 750527660
Change-Id: I6b34944c92483ea2abc774df75efd868255a2bac
2025-04-23 03:27:41 -07:00
Yuval Tassa c2ac0d724e Add mju_gather and mju_scatter, private engine functions.
PiperOrigin-RevId: 750245294
Change-Id: I3a14ccdd55a324d3fe206e388fb2a513772f5f5e
2025-04-22 10:33:33 -07:00
Alessio Quaglino 99490163df Prevent NaN in cylinder SDF.
Fixes #2573.

The correction matches the one used in MJX (see _cylinder_grad in collision_sdf.py).

PiperOrigin-RevId: 747887406
Change-Id: I1a4f1ac769adb96c98665eace7ce54fb09a7d3a2
2025-04-15 08:34:05 -07:00
Taylor Howell d168135189 Remove duplicate test_tendon_force_clamp from inverse_test.py.
PiperOrigin-RevId: 747835971
Change-Id: I96ca7a2e3f71dbc05af238c269a81b41b51fa48b
2025-04-15 05:40:25 -07:00
Saran Tunyasuvunakool 71a7004057 Fix array extent parsing logic for introspect.
Also fix the mjxmacro_test to correctly assert that all array extents defined in the X macros can be correctly parsed from field comments.

PiperOrigin-RevId: 747808525
Change-Id: I0b08dc263f8a46118a07200ae044d6c491207245
2025-04-15 04:03:04 -07:00
Alessio Quaglino ec186430ef Add setting plugin config properties via Python bindings.
PiperOrigin-RevId: 747421357
Change-Id: Ie80f1a889f2f6ec457c1e16193fa0694e07d3fe9
2025-04-14 08:07:14 -07:00
Taylor Howell f317bd17c3 Add tendon actuator force sensor to MJX.
PiperOrigin-RevId: 747344916
Change-Id: Iab513ff953408c002216ffff12e3f8c825cedc10
2025-04-14 03:51:20 -07:00
Google DeepMind 8e7457d7c6 Initial support for writing UsdPhysics data starting with UsdPhysicsRigidbodyAPI support.
The SDF_FORMAT_ARGS `usdMjcfToggleUsdPhysics` is introduced to toggle writing UsdPhysics or not when converting. Off by default

PiperOrigin-RevId: 746467942
Change-Id: I26cb9a4c4ae2eef96163dab967a74f14940a2a6d
2025-04-11 08:19:11 -07:00
Gabe Oppenheimer 006c18b1d8 Update numbering in the 3.3.1 release notes to give MJX a numbered bullet in the docs.
PiperOrigin-RevId: 746455557
Change-Id: I04849ed1a5b97c0f6408d2333b13419e6cd35688
2025-04-11 07:37:24 -07:00
Sam Haves 446a8f1742 Add basic site support to Mjcf SdfFileFormat plugin.
We will still need to tag these with a custom API schema to ease round-tripping but that will follow creation of such a schema.

PiperOrigin-RevId: 746421793
Change-Id: I2df2209b4bc90d763718fb4bea8158b8598755c6
2025-04-11 05:28:03 -07:00
Gabe Oppenheimer 440ce5eb7a Update the version number to 3.3.2 following the 3.3.1 release.
PiperOrigin-RevId: 746147577
Change-Id: Idb7b4e7e06a4730b4f2eea8f6600b898e998f8db
2025-04-10 13:17:20 -07:00
Alessio Quaglino a209134315 Enable procedural plugin activation in Python bindings.
PiperOrigin-RevId: 746055614
Change-Id: Idcc2f62fdfeccdca356e3d1acadf168b46a98881
2025-04-10 09:13:21 -07:00
Kyle Bayes b1f8d444f2 Fix bug in replaceSimplex3 in nativeccd.
PiperOrigin-RevId: 746014344
Change-Id: I93b32ab5f67ee48ab72238de53f7cda07638cb79
2025-04-10 07:04:27 -07:00
Yuval Tassa 25126e88c7 Move mju_cholFactorCount to engine_util_solve.
PiperOrigin-RevId: 746011856
Change-Id: If9812251420053644f4eca81adb5116d370ee524
2025-04-10 06:56:31 -07:00
Taylor Howell 3c530976e3 Add rne_postconstraint dependence for FRAMELINACC and FRAMEANGACC sensors to MJX.
PiperOrigin-RevId: 746009774
Change-Id: Ide45298b463f1ad04f1ffa7f60a7a8aeaf18f063
2025-04-10 06:48:40 -07:00
Taylor Howell 51c489fc30 Add inverse dynamics to MJX.
PiperOrigin-RevId: 745998273
Change-Id: I203af89332ace5d7a60fff3ec6ff4cc88c02340d
2025-04-10 06:08:41 -07:00
Yuval Tassa d3664b5d01 Avoid square root in mju_makeFrame
PiperOrigin-RevId: 745974380
Change-Id: I90879fac05e62daf60acd2223f814e833634b242
2025-04-10 04:41:23 -07:00
Mohammad Hamid 3429a4881a Detect mismatch between maxNodes and Nodes in a gmsh block. Fixes #2342
PiperOrigin-RevId: 745967745
Change-Id: If1b5fcd71079a0e6a6def9b442758678e31a5828
2025-04-10 04:15:21 -07:00
Sam Haves eadd13038a Move Mujoco struct wrappers definitions into library separate from pybind module.
This allows other modules to depend on functions such as FromRawPointer that previously were only defined in the _struct python module.

PiperOrigin-RevId: 745619670
Change-Id: I9f1af60cb665c00d853b7ca38201b37302d278af
2025-04-09 09:28:40 -07:00
Gabe Oppenheimer da1850760a Prepare for v3.3.1 release.
PiperOrigin-RevId: 745602958
Change-Id: I412fd58bb063959d5a151f4bca9b3ba26e942d02
2025-04-09 08:40:30 -07:00
Sam Haves 5c12ea871f Split MjSpec out into header to allow use by other pybind modules.
This should enable other pybind modules to accept arguments of type MjSpec.

PiperOrigin-RevId: 745580987
Change-Id: I435a8d264149369e3fbee14c5d2c628ef74b2541
2025-04-09 07:31:23 -07:00
Kyle Bayes 85b323c7fb Remove square roots when possible in EPA improving numerical precision.
PiperOrigin-RevId: 745559836
Change-Id: I3f8b23406e93ccfc4bc3499bfbed829b35462a74
2025-04-09 06:18:51 -07:00
Taylor Howell 8fc616bf8f Add tendon actuator force limits to MJX.
PiperOrigin-RevId: 745529685
Change-Id: I43c372116daefc3dd2ed6ad1bb9c6e3978bc8527
2025-04-09 04:28:45 -07:00
Yuval Tassa 5031f88158 In minimize.least_squares, compute values at the solution at full verbosity.
PiperOrigin-RevId: 745301888
Change-Id: Ibd8e35e405bb2cebc7ac59a6dfc77118a6e6ba9f
2025-04-08 14:55:53 -07:00
Copybara-Service 699ad13a72 Merge pull request #2503 from Andrew-Luo1:rscope
PiperOrigin-RevId: 745266549
Change-Id: I15d2eb992aae643ac096650693cc0750421f14c6
2025-04-08 13:21:47 -07:00
Yuval Tassa 55e3ca3acf Improvements to minimize.least_squares.
All changes make functionality more similar to SciPy least squares:
- Use adaptive findiff epsilon.
- Make termination on step size relative to norm(x).
- Add termination on gradient norm.
- Make default tolerances like SciPy's.

PiperOrigin-RevId: 745221614
Change-Id: Iee93256651fca8154c97fa3bdaa9c67ede28e573
2025-04-08 11:23:24 -07:00
andrew fc516ee3c1 revert import order 2025-04-08 14:06:17 -04:00
Taylor Howell 96dda6ea75 Add tendon actuator force limits and tendon actuator force sensor.
PiperOrigin-RevId: 745096883
Change-Id: Ib9acb727fbbfc6b0b0323ee6a889053a7a878056
2025-04-08 05:16:35 -07:00
Yuval Tassa 16e49f2761 Advertise the Model Editing tutorial
https://youtu.be/LbANnKMDOHg?si=GiN7UPPhTh89c8aN

PiperOrigin-RevId: 745065758
Change-Id: Ic3d3e0603b6f6360580effb52b6cf3438efe2a53
2025-04-08 03:25:20 -07:00
Baruch Tabanpour 4e0a4f4d39 Defer device puts to the end of make_data. Fixes #2461.
PiperOrigin-RevId: 744875869
Change-Id: I8d88d4f73407b44f761d01309e2cc28b43aa305f
2025-04-07 15:43:43 -07:00
Kyle Bayes 606f00f802 Remove contact pruning with box-box collisions in nativeccd and add benchmarks.
PiperOrigin-RevId: 744732382
Change-Id: I2e20b646c541ee99888f1e964302d1b4363b2dc4
2025-04-07 08:34:04 -07:00
Alessio Quaglino d7027fb1c0 Do not skip mjSpec's with repeated model names when attaching a new mjSpec.
PiperOrigin-RevId: 744705838
Change-Id: Ie47a3c029f443910629619b7f9ff43ab07646725
2025-04-07 06:52:12 -07:00
Kyle Bayes 58234b2217 Replace mjMAXVAL with numerical max limit where necessary in nativeccd.
PiperOrigin-RevId: 744693156
Change-Id: I72c3122701be281d468291dfc2ad1e4bb1da5a1c
2025-04-07 05:59:02 -07:00
Alessio Quaglino cc2f57d820 Change mjSpec and mjModel signature mechanism.
The signature now contains the necessary information to safely perform `bind`. The private UIDs are now removed.

Fixes an issue of changing signature when compiling a copy of an mjSpec.

PiperOrigin-RevId: 744670626
Change-Id: Id3c66419cf2afbe78e91bc4b37d2299f5ec00ab1
2025-04-07 04:21:27 -07:00
Yuval Tassa 93251f07d9 Install timers by default in Python bindings
PiperOrigin-RevId: 744663306
Change-Id: Ia322ace94d1f269ff9b0275567b2e453acc94843
2025-04-07 03:54:24 -07:00
Yuval Tassa 26c14c500e Fix bug in testspeed.cc for models that do not invoke the constraint solver.
PiperOrigin-RevId: 744650422
Change-Id: I0d49b7a3f3069f0c066e8758627e95f973b3a728
2025-04-07 03:01:24 -07:00
Yuval Tassa d05251af2a Add tendon armature
PiperOrigin-RevId: 743939992
Change-Id: I587214f5d6fabbc0cc273c33d82decbe9ad8f919
2025-04-04 07:44:04 -07:00
Yuval Tassa e1f5ceb65a Add mjModel.tendon_armature (in preparation, not yet implemented)
PiperOrigin-RevId: 743649968
Change-Id: I1d893e3e06afc48b652575bc7837750ab3573670
2025-04-03 12:06:27 -07:00
Yuval Tassa f96f3e1c22 Add XML compiler/saveinertial flag. Fixes #2405
PiperOrigin-RevId: 743607654
Change-Id: I1f2e61be89b79c1995e079f36aa285096f9fb441
2025-04-03 10:12:42 -07:00
Alessio Quaglino 8941f56e86 Copy UIDs during mj_copySpec.
This will produce the same mjSpec signature after a deep copy.

PiperOrigin-RevId: 743538018
Change-Id: Ic0f5b06a00e8883cb92dc98159db3bea02cb7a36
2025-04-03 06:29:07 -07:00
Baruch Tabanpour 54f132f3f0 Resolve discrepancy in RK4 between MJX and MJ.
PiperOrigin-RevId: 743185866
Change-Id: I478faca1d8733999cc9a0682e931b19ee05e3843
2025-04-02 10:16:07 -07:00
Google DeepMind 40393f460a Fix shadow flickering artefacts on platforms that do not support ARB_clip_control.
PiperOrigin-RevId: 743112447
Change-Id: Ibb727685605c0a257547162703f61e5232ff544c
2025-04-02 06:34:27 -07:00
Alessio Quaglino b839fe79e1 Allow to attach an entire mjSpec in mjs_attach.
PiperOrigin-RevId: 742737713
Change-Id: Ie172568b8c35232e1f13d75aebee20346e76e95b
2025-04-01 09:51:52 -07:00
Yuval Tassa e5912c3ce4 Use tolerance to compare quaternion components in UserObjectsTest.Inertial
Fixes #2515

PiperOrigin-RevId: 742704324
Change-Id: Ib26891e43128e66d2ac1840ed574285781fb12a5
2025-04-01 08:12:01 -07:00
Alessio Quaglino a02a27d4a4 Combine all mjs_attach functions into one.
PiperOrigin-RevId: 742702092
Change-Id: I89e35c59ada017cd061e2031584eeea71776743d
2025-04-01 08:05:58 -07:00
Kyle Bayes 08d22baea1 Fix bug in horizon code in nativeccd where parallel faces are included in horizon.
PiperOrigin-RevId: 742687622
Change-Id: I4a180cb9c7451e0a2c22ffd77b7b6f6fd68836a4
2025-04-01 07:21:14 -07:00
Yuval Tassa 305b68ecbf Add tests for body.find_all() of joints and geoms, fix error message.
Fixes #2525

PiperOrigin-RevId: 742685596
Change-Id: I5f0969967f2490d32e5691983e8d0c363d48a6bd
2025-04-01 07:14:59 -07:00
Alessio Quaglino c0a7ea1edb Added the element type mjOBJ_SPEC for mjSpec.
PiperOrigin-RevId: 742678572
Change-Id: I95a382ac58b5bc88c2aa5c07210549a1d5e2f538
2025-04-01 06:51:49 -07:00
Kyle Bayes 9ecec6f238 Fix bad contact from passing through polytope2 in nativeccd.
PiperOrigin-RevId: 742666700
Change-Id: I76034579b4e663f9abfa265ec3e2bc608f631f59
2025-04-01 06:11:20 -07:00