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
Copybara-Service
0f456486a4
Merge pull request #2545 from maxzand:main
...
PiperOrigin-RevId: 742655847
Change-Id: Id2b3daf1be022620e1262a96052791c88e25b3eb
2025-04-01 05:40:00 -07:00
Alessio Quaglino
648a03c2cf
Override inertia of body with visual geoms if discardvisual is true.
...
Fixes #2546 .
PiperOrigin-RevId: 742650702
Change-Id: I753c1e1c89da732ece100676644bbecf9d6373bb
2025-04-01 05:21:48 -07:00
Alessio Quaglino
86c970bc23
Add error checking in mjs_setFrame.
...
Also raise error if the frame is not found in the mjCBody copy constructor.
Fixes #2543 .
PiperOrigin-RevId: 742624013
Change-Id: I4999b3165c97f8d079412214d027ca7a8dae8cb3
2025-04-01 03:34:48 -07:00
Alessio Quaglino
ebd30493c8
Allow nameless bind in MJX.
...
PiperOrigin-RevId: 742592221
Change-Id: I9490aebd64e3a31219c552d5b6eb55236680f10d
2025-04-01 01:45:44 -07:00
Yuval Tassa
05f3e914b0
Improve armature documentation
...
PiperOrigin-RevId: 742583729
Change-Id: I18d1c95a91f4d70b842c680d4a0f4d0b04476894
2025-04-01 01:16:58 -07:00
Yuval Tassa
400a379b70
Update doc requirements.
...
PiperOrigin-RevId: 742324590
Change-Id: I55d6535190a2281aec04ff16bd3f82f6c85870f9
2025-03-31 11:05:10 -07:00
Yuval Tassa
8bcfe07e14
Fix potential division by zero in mj_tendonDot.
...
PiperOrigin-RevId: 742246626
Change-Id: I1f897bd0ca28e0efdffc5a93fadca35221eaeb38
2025-03-31 06:41:26 -07:00
andrew
65500cfbdc
improve variable and function names
2025-03-30 22:19:55 -04:00
Maxime
1f590c1275
Fixed contact force legend and added legends for accel and velocity
2025-03-28 19:50:52 -04:00
Alessio Quaglino
01d4c46753
Store the mjsCompiler -> appended mjSpec map when appending an mjSpec.
...
Previously, we stored the source `mjSpec` during a copy as a hack for having access to the compiler options, but this is not robust since we cannot guarantee that 1) the source `mjSpec` is not destroyed before we need to look up the compiler options nor 2) that the `mjSpec` was appended without a copy.
While 2) could be solved by simply handling an additional case in `mjCModel::FindSpec`, using a map also solves 1) and it is easier to understand.
PiperOrigin-RevId: 741504264
Change-Id: Iab1bfd9e61299a94fa8caf3a244c067b09d54384
2025-03-28 06:27:22 -07:00
Alessio Quaglino
6e19035aab
Add delete and detach docs.
...
PiperOrigin-RevId: 741444657
Change-Id: I4207eaf74524e8a3ca46130967c6fb0dd62b4d64
2025-03-28 01:58:54 -07:00
Kevin Zakka
e272e46770
Rename simulate "copy pose" button to "copy state", also save "qvel', ctrl, mpos and mquat if present. SHIFT-click will save values at full precision.
...
Example formatting:
```
# default precision
<key
time="2.99"
qpos="9.4287e-07 3.02972e-07 1.19963 0.999999 -9.3978e-06 0.00102591 8.06948e-06 -0.000337469 -0.000182994 -0.00282448 -0.000358084 -0.00370829 0.0631084 0.0996347 -0.00161963 0.0260658 -2.09992 -0.00459387 0.0474729 -0.0171906 0.0018216 0.72549 0.00133026 0.724951 0.000816735 0.724389 0.000454671 0.724 -0.00146646 -1.12233e-05 -0.0995942 0.00159877 0.0261695 -2.09993 0.00458912 0.0473279 0.0171317 0.00177837 0.725447 0.00131597 0.724941 0.00081406 0.724393 0.000465918 0.72402 -0.00140271 -1.42355e-05 0.0949171 0.0790632 -0.461397 1.02664 -9.42133e-05 -0.55539 -0.0952333 -0.0790705 -0.460978 1.02899 8.38339e-05 -0.671707 0.401772 0.197427 1.00101 0.999979 0.00125793 -0.00100982 -0.00631542"
qvel="0.000132784 3.49155e-05 0.000536692 -0.000560519 -0.0242142 0.00693928 0.00119816 -0.000234844 0.00350923 -0.00036047 0.00137217 0.026605 0.000647559 -0.000813737 0.00151335 0.00158296 -0.000628786 0.0184574 -0.000751955 8.75972e-05 0.00017462 9.47749e-05 0.00018949 7.40435e-05 0.000170318 -2.65743e-05 5.67808e-05 0.000256585 -8.77605e-05 -0.00070146 5.90881e-05 0.00186213 0.00150788 0.000645196 0.0183261 -0.00189709 0.000234144 0.000180699 0.00020344 0.000161977 0.000154203 0.000127231 2.28526e-05 -2.85628e-06 0.000232213 2.32483e-05 -0.000415728 0.000285987 0.00873081 0.00361353 5.70155e-05 0.000316513 -0.00778618 0.00404914 -0.0239508 -0.0375704 -0.000528571 4.92965 3.51479e-15 -4.54231e-16 -9.39907e-15 -7.5733e-14 -1.54433e-14 8.71183e-14"
ctrl="0 0 0 0 0 0 0.106158 0 0 -2.1308 0 0 0 0 0 0 0 0 0 -0.106158 0 0 -2.1308 0 0 0 0 0 0 0 0 0 0.1 0.08 -0.477 1.033 0 -0.556 -0.1 -0.08 -0.477 1.033 0 -0.556"
mpos="0.5 0 0.5 0.5 0 0.5 0.5 0 0.5"
mquat="1 0 0 0 1 0 0 0 1 0 0 0"
/>
# full precision
<key
time="19.78000000000035 "
qpos="-5.456931939182209e-13 4.210058291674657e-14 1.199596868198444 0.9999997705632744 -1.123107929038176e-05 -0.000677308838908712 -4.574736052563342e-13 4.81467762006399e-06 -0.0001470530836508491 -0.01285126600561344 -0.0003314670141921113 -0.003753266058087929 0.06165064101255623 0.01573179146576803 -3.013291189105153e-05 0.00898818165332332 -0.0005543865919957537 0.001960768693378906 0.003171337599202657 0.05998529721754536 -0.006869809693640725 0.7108455550986151 -2.768022862919269e-05 0.7234287700347743 -2.65358465809282e-05 0.7234305602907817 -2.427451970418236e-05 0.7234340023869628 0.0001444026830625057 0.004779116304496144 -0.01556918200171751 2.367030531882565e-05 0.00887857821391661 -0.0005393749458389281 -0.002002170464405725 0.004065365245773832 -0.059404381452836 -0.006700853036263364 0.7112073591870905 -2.793780628594305e-05 0.7234283783336887 -2.67570932686378e-05 0.7234302250735107 -2.446320244250625e-05 0.7234337167312712 0.0001441442525519209 0.004776981844081063 0.001964241516442131 -0.001279289930183057 0.0009901921906584617 0.005102724602622095 -0.0001969944416873799 0.0006055390861509305 -0.001981889349334628 0.001289775046291938 0.0009924227912350586 0.005084179458414934 0.0001970337430004949 0.0006055492125132441 0.4000059982468001 0.2000006330421453 1.001005166968155 0.9999986986616857 0.001264259603338192 -0.00100188514175821 -2.342548568520312e-05"
qvel="8.028421913635349e-14 -7.933623204015651e-15 -1.766955416585763e-09 -1.242788325114248e-10 1.380680257623891e-08 4.072776622758517e-13 -2.152263214542579e-08 -3.878177040643757e-09 -7.698904695669224e-07 1.032750347898222e-09 -1.203279562630678e-09 -7.551458300921444e-08 2.469496246057255e-06 8.917880101195273e-08 -6.756803792056489e-06 -2.872076666906819e-06 1.785650772865195e-06 -5.01959632083366e-06 -5.599940213931672e-06 8.890181416091634e-07 1.64456042549838e-06 -1.371426840474208e-09 -2.120678515220117e-09 -2.024654983099582e-09 -3.146661587304676e-09 -2.584650818327909e-09 -4.007447393764789e-09 3.46515937628953e-09 1.271775029987075e-08 -2.488928508740539e-06 -8.746797042033161e-08 -6.8499144406484e-06 -2.901446048768352e-06 -1.790798673741401e-06 -5.013863339758384e-06 5.931327072492727e-06 9.379458926032098e-07 1.728266244061688e-06 -1.546731198107214e-09 -2.391411625987869e-09 -2.205072839286403e-09 -3.425520861505272e-09 -2.768770278332858e-09 -4.29204657928239e-09 3.77970711367913e-09 1.210836106515995e-08 2.48779855243758e-07 1.794262457563144e-08 2.425338558609319e-07 -4.490996387632652e-09 1.5470867213074e-10 -1.056275279772894e-10 -2.528203830071622e-07 -1.984360361016969e-08 2.432485190492325e-07 -4.490126811319184e-09 -1.553085076375719e-10 -1.050844929338509e-10 -5.03087850573677e-15 -3.069973955284326e-15 1.263049899085103e-14 -2.132657422360499e-13 1.240631051776082e-14 7.346260313161907e-14 "
ctrl="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "
mpos="0.5 0 0.5 0.5 0 0.5 0.5 0 0.5 "
mquat="1 0 0 0 1 0 0 0 1 0 0 0 "
/>
```
PiperOrigin-RevId: 741427042
Change-Id: Ib33f3e6215b7933d9267fc4c222d7a0abc75dbb4
2025-03-28 00:38:19 -07:00
andrew
97092facd6
resolve PR comments
2025-03-27 19:35:36 -04:00
Taylor Howell
0abf184d49
Align comment in mjmodel.h.
...
PiperOrigin-RevId: 741214316
Change-Id: I449c4a6e1c70b30d60636e11f26fb0bc8653f2a5
2025-03-27 11:05:46 -07:00
Alessio Quaglino
e8c67ca586
Allow orientation for user composite.
...
PiperOrigin-RevId: 740909723
Change-Id: Id38a55114d4257a461bbced57d35d6bb42a2597d
2025-03-26 14:44:51 -07:00
Google DeepMind
644b42bee3
Add mujoco/experimental and move USD work there.
...
PiperOrigin-RevId: 740730698
Change-Id: If9c68798cda502d6d7632906a034437e2557802e
2025-03-26 05:37:45 -07:00
Alessio Quaglino
5c955b8fe2
Add frame support to the cable composite.
...
Also cleanup user_composite.cc includes.
PiperOrigin-RevId: 740730596
Change-Id: I05df59926d8e61de45fd6b2a3a63121b7a390448
2025-03-26 05:36:36 -07:00
Kyle Bayes
d6943731b2
Fix bug in nativeccd multiccd.
...
PiperOrigin-RevId: 740495321
Change-Id: I7eaa0da8514e27c233d49567c276d1d238808d1f
2025-03-25 14:56:21 -07:00
Alessio Quaglino
69f8349203
Add signature error checking at the end of compilation.
...
Fixed some edge cases that caused the new error to be triggered.
PiperOrigin-RevId: 740483759
Change-Id: I6ced3ba55476d5c18103e205151ecace94f2b29b
2025-03-25 14:22:58 -07:00
Alessio Quaglino
157b074116
Add signature to mjSpec and mjModel and use it to perform safe bind to mjModel and mjData.
...
PiperOrigin-RevId: 740378879
Change-Id: If14b326942529494f172e7aedcae30195798b458
2025-03-25 09:37:49 -07:00
Yuval Tassa
c931565fdc
Add internal functionmj_tendonDot: time derivative of tendon Jacobian for one tendon.
...
Notes:
- Currently always uses dense math, even for sparse models. This should be easy to change in the future.
- Does not support geom wrapping. This is possible but harder, requires derivatives of mju_wrap.
PiperOrigin-RevId: 740378741
Change-Id: Id39ef2c4bfbb7ee11ec33c97d7d83140441cdab2
2025-03-25 09:36:30 -07:00
Alessio Quaglino
4e206c29c1
Keep tree lists updated at all times.
...
This simplifies the compiler logic since an updated tree list was necessary at many stages (e.g. attach and keyframes resizing) and it will be anyway required when computing the mjSpec signature.
PiperOrigin-RevId: 740356447
Change-Id: I7f2ec25b27b8d4ca4364801c9a401c40c6d84569
2025-03-25 08:21:22 -07:00