Commit Graph

1276 Commits

Author SHA1 Message Date
Nimrod Gileadi e3df84ec3f Include the size limit in error message from mjr_addAux.
This is to help debug #1274.

PiperOrigin-RevId: 590215990
Change-Id: I356675be84f9cb2892d31d4dc7639adf49fe4a0f
2023-12-12 08:41:10 -08:00
Yuval Tassa 35f095d7c5 When paused in simulate, add index of history scrubber if not 0.
PiperOrigin-RevId: 590184966
Change-Id: Id0914c41a1339cf71ebdea02ec486c52c3d37179
2023-12-12 06:43:37 -08:00
Yuval Tassa 28a9e6d9a2 Add mjNOBJECT value to mjtObj enum.
PiperOrigin-RevId: 590164716
Change-Id: I500741aa4fb97fe2c4f5d2086188bb2c9fdfd1a0
2023-12-12 05:15:00 -08:00
Yuval Tassa 64c33cefcf Correct formula for solref direct stiffness. Fixes #732.
PiperOrigin-RevId: 590144795
Change-Id: I94def777c7456243509374caecea2a335859f1f2
2023-12-12 03:56:18 -08:00
Nimrod Gileadi aed4254d65 Fix the table formatting in plugin/actuator/README.md.
The line continuation format that was used is not supported on GitHub.

PiperOrigin-RevId: 590141362
Change-Id: I0ab0dabfb8977bdf79682476376dda435787eba0
2023-12-12 03:42:45 -08:00
Copybara-Service 5c8f22609a Merge pull request #1263 from limymy:main
PiperOrigin-RevId: 589857317
Change-Id: I5f241f5c798811b0d082ba4bed9ca8c8233e4052
2023-12-11 09:59:59 -08:00
Yuval Tassa 07e05b4c55 Fix typo. Fixes #1221
PiperOrigin-RevId: 589835888
Change-Id: Iacedbe642709d5fbd43b7f0f1f9daa6447ce6155
2023-12-11 08:42:06 -08:00
Yuval Tassa 1885d518eb Use the string (rot:lin) in mjdata.h to clarify where 6D motion vectors use the Featherstone convention. Also add clarifying text to the appropriate note in the documentation.
Fixes #982.

PiperOrigin-RevId: 589556339
Change-Id: I3e7ff185a089715a386694321d4b89d09d481cf9
2023-12-10 03:27:44 -08:00
Yuval Tassa b22919543d Fix bugs related to saving of <statistics> values.
Before this change:
- User-modified values of `mjModel.stat.{meanmass, meaninertia}` would not be saved to XML.
- Non-user-modified values of `mjModel.stat.{meansize, extent, center}` would always get saved to XML.

After this change values are saved to XML only if provided by the user, either in the XML or by changing values in `mjModel` before saving.

PiperOrigin-RevId: 589473351
Change-Id: I4dcf4892ef61c35edf424226e731232d861bad8d
2023-12-09 16:06:39 -08:00
Baruch Tabanpour e7d637f375 Fix issue with foot vel in MJX notebook
PiperOrigin-RevId: 589276253
Change-Id: I2c8c24e42d037d8c59667364a298f8b669d779b6
2023-12-08 16:44:36 -08:00
Copybara-Service 263451a3f2 Merge pull request #1267 from JamieMair:updated-3rd-party-mujoco-bindings
PiperOrigin-RevId: 589268337
Change-Id: Ia3f3c392f6df5a6d778b2e0b1f9278195b0a42c3
2023-12-08 16:11:49 -08:00
Yuval Tassa 7942fe957e Circumvent bug in mjc_BoxBox.
The box-box collider sometimes outputs bad contact points which are far outside one of the two boxes. This happens at configurations which are very rare numerically, but rare configurations (e.g. perfect box alignment) are often induced by the designer and the physics, making them actually not-so-rare.

Since the box collision functions are very difficult to understand, we circumvent the issue by extending the post processing code to detect and remove such contacts.

PiperOrigin-RevId: 589178197
Change-Id: I82b8a888ef04f9196111c960757e3314d0ab6d8e
2023-12-08 10:39:27 -08:00
Alessio Quaglino a006b15958 Add map from objects names to their index.
Also some minor cleanup of repeated code in user_model.

PiperOrigin-RevId: 589135294
Change-Id: I16f22c4dbdde961cedc042af3bdc9d3577d33459
2023-12-08 08:14:16 -08:00
Alessio Quaglino 623201ec76 Throw error if scale attribute is used with an SDF.
Fixes #1210.

PiperOrigin-RevId: 589101807
Change-Id: I3f2796de3438fbcdaf9221bddc5c9bd82aedb7cb
2023-12-08 05:41:22 -08:00
Yuval Tassa b1a912e9e2 Improve readability of test.
PiperOrigin-RevId: 589048504
Change-Id: I5087cfd67481df90103da2d7f5f06e421fc28e11
2023-12-08 01:18:59 -08:00
Alessio Quaglino 1db0a9946f Fix frame accumulation order for <frame> meta-element.
PiperOrigin-RevId: 588803425
Change-Id: Id0289c34d1a6cfb6007540a29cc1f32d879e43ed
2023-12-07 08:37:20 -08:00
Alessio Quaglino d12fe594d9 Add suffix to duplicated assets.
PiperOrigin-RevId: 588775467
Change-Id: I3a0d2a14601cf018b0c8c56728bd3ae22adb8ec2
2023-12-07 06:46:51 -08:00
Jamie Mair 14e9607d3a Edited README to update the entry for the Julia 3rd party bindings 2023-12-07 11:16:10 +00:00
limymy 08c6233912 fix gcc warning "stringop-truncation" 2023-12-07 14:36:29 +08:00
Copybara-Service e4359c04df Merge pull request #1253 from Balint-H:feature/unity-hmap
PiperOrigin-RevId: 588420615
Change-Id: I2340f2fc025017133644eeedacf94b5c83e04669
2023-12-06 07:32:45 -08:00
Yuval Tassa 762371c3e4 Add kv damping attribute to position and intvelocity actuator shortcuts.
PiperOrigin-RevId: 588377097
Change-Id: I8ded2ff982e52ed8673019979e29b706ef65c743
2023-12-06 04:28:30 -08:00
Erik Frey b3ccf67ebf Cleanup MJX tests and migrate them to put_model/put_data.
PiperOrigin-RevId: 588304729
Change-Id: I58075383e6eed64ae00cea305a568eba6465b0b0
2023-12-05 23:08:05 -08:00
Kevin Zakka 899ba4b7ec Add missing period in documentation.
PiperOrigin-RevId: 588127219
Change-Id: Ib39808f303cebb6c619d1119024e9a1352326473
2023-12-05 11:02:26 -08:00
Nimrod Gileadi 5e9906be84 s/paramters/parameters/
PiperOrigin-RevId: 588113325
Change-Id: I1b7e754c747baedb8d2b154c3dc395a7062e8fc5
2023-12-05 10:20:04 -08:00
Nimrod Gileadi 3c05f9fafc Add a note to future change log about releasing 10.16 macOS wheels.
This change relates to #1213, and should fix it when we push the next release.

PiperOrigin-RevId: 588099974
Change-Id: Ic1c4164f8a6400e92b5f509c3e03ff9fbc1c6033
2023-12-05 09:39:52 -08:00
Alessio Quaglino 8c7c39a211 Lock the sim mutex in PhysicsLoop and PhysicsThread.
This prevents an invalid memory access when the stack is used in engine_vis.

Fixes #1219.

PiperOrigin-RevId: 588017796
Change-Id: I1ee18c5aa5e96ccaeebb0a467cd384355882b80b
2023-12-05 03:56:52 -08:00
Nimrod Gileadi c062a8db19 Allow multiple actuators to use the same PID plugin.
Maintain separate state for each actuator in the Plugin object.

PiperOrigin-RevId: 587760569
Change-Id: I633a1b94f0dde9377120145066a26aef6a4033b8
2023-12-04 10:08:07 -08:00
Nimrod Gileadi 236dcb4ffd Fix a bug with PID actuators, when plugin definition order differs from actuator order.
PiperOrigin-RevId: 587729879
Change-Id: If71c7e374f36ef08c5147e7316066d6f5365925f
2023-12-04 08:31:45 -08:00
Bálint Hodossy f5a2879f9d Fix braces convention 2023-12-04 14:00:24 +00:00
Bálint Hodossy 8ec1e4e2b8 Add heightfield geom type with Unity terrain, import not yet supported 2023-12-04 13:55:38 +00:00
Matthew Bennice c0b7b9873d Store paths for hfields, textures, and skins similar to meshes.
PiperOrigin-RevId: 587283093
Change-Id: Ie6d8d2ecb185697a27d1b6f7fca1312df006af12
2023-12-02 03:51:25 -08:00
Erik Frey 67fa7c1dc2 Add put_model, put_data, and get_data to MJX.
These io functions replace device_put, device_get_into. These new functions correctly copy intermediate fields such as efc_J, which the old functions could not.

PiperOrigin-RevId: 586712273
Change-Id: Ia3a4104af17db2ebd41b41a2ca501c5de9ac5d05
2023-11-30 10:14:46 -08:00
Alessio Quaglino 4c8ffb44bf Extend SDF outside the bounding box for SdfLib plugin.
SdfLib returns the sum of the distance from a given point to the bounding box and a saved minimum distance from the surface over the whole box boundary. This underestimates the true distance and can cause spurious contacts and jittering. This CL performs a box projection of points outside the bounding box and adds the distance of the original point from the box to the distance of the projected point to the surface. This overestimates the true distance and avoids spurious collisions.

PiperOrigin-RevId: 586701933
Change-Id: I22eecb9757fa22359440156ef6433135648fa3ff
2023-11-30 09:43:06 -08:00
Nimrod Gileadi a306e32707 Add new hash for scipy in mjx/requirements.txt
PiperOrigin-RevId: 586674164
Change-Id: Idcda8f57addbce331da04cc1510e01ff91563040
2023-11-30 07:48:45 -08:00
Alessio Quaglino 33bd2a986a Use mesh_pos, mesh_quat instead of geom_pos, geom_mat in ray_sdf.
PiperOrigin-RevId: 586632872
Change-Id: I39f99945ccdd6c54f7867adfe06a379d00dc8002
2023-11-30 04:26:07 -08:00
Yuval Tassa b39cca725a Move headlight pos/dir computation from mjr_render to mjv_updateScene.
PiperOrigin-RevId: 586630110
Change-Id: Ia44ea944016ccfe081682375cdb975342695d826
2023-11-30 04:15:05 -08:00
Yuval Tassa 822b03446c Improve pipeline documentation, expose mj_implicit function to public header.
PiperOrigin-RevId: 586380774
Change-Id: I3fafa563ebc852e17e1233288455b96f4499027b
2023-11-29 10:18:57 -08:00
Erik Frey 2f37147fc0 Guard against NaNs in MJX solver when no cost is imposed. Fixes #1225.
PiperOrigin-RevId: 586020958
Change-Id: I82f398b1538d2c3801a35c80c862e49be3b110a2
2023-11-28 10:12:17 -08:00
Alessio Quaglino e1669b568b Change default values of flex visualization flags.
Deactivated vertices, edges, faces and activated skins. The skin is less precise but faster to render and more importantly when the wireframe is active it allows to look inside the body much more easily.

PiperOrigin-RevId: 585970250
Change-Id: Icb6c0ff6266e552cffce9b0c810f634f9a29a55e
2023-11-28 07:27:54 -08:00
Copybara-Service 9075f2cb74 Merge pull request #1222 from Balint-H:fix/ball-joint-tooltip
PiperOrigin-RevId: 585964341
Change-Id: I59fca025b1005317279f43b8f621e62b0f80fe62
2023-11-28 07:04:50 -08:00
Alessio Quaglino 7d8d4d398e Make elasticity plugins compatible with flex pins. Fixes #1235.
Before change:
poncho       18.20s
poncho_flex  44.60s
floppy       4.70s
floppy_flex  6.43s

After change:
poncho       18.23s
poncho_flex  44.62s
floppy       4.67s
floppy_flex  6.57s

PiperOrigin-RevId: 585952587
Change-Id: I0e7c1513f64c7ab1e6ad71e2168b4467c042b46f
2023-11-28 06:13:43 -08:00
Alessio Quaglino 7cb84d45c1 Prevent integer overflow in history buffer for large models.
PiperOrigin-RevId: 585949038
Change-Id: Iabec5feedd1632b635583a608a5488b39e6bb9a2
2023-11-28 06:04:00 -08:00
Yuval Tassa 51d80564fa Don't initialize plugins during model compilation.
PiperOrigin-RevId: 585701389
Change-Id: I4e5e34276f404abadf6f5d4d9764ca717304ee34
2023-11-27 11:01:08 -08:00
Nimrod Gileadi 6412c95a37 Remove the use of plugin_state from PID plugin.
The plugin was storing a boolean to indicate whether the previous ctrl value was set in `act`. Use d->time == 0 instead.

PiperOrigin-RevId: 585692686
Change-Id: I95335cebdb5716bd6fad81f463a4f248406c80ec
2023-11-27 10:32:07 -08:00
Baruch Tabanpour 35c90844ae Add sites to MJX.
PiperOrigin-RevId: 585691582
Change-Id: I6cc594daf436231f91534f137ff259e7b39811d9
2023-11-27 10:28:50 -08:00
Yuval Tassa 37bb03f435 Move humanoid geoms to group 1
PiperOrigin-RevId: 585632746
Change-Id: I832804b9c0d090506c3b4ed5c0eeeb5e4cae412a
2023-11-27 06:23:54 -08:00
Yuval Tassa 21334ea704 Delete local frame members from MJC objects.
PiperOrigin-RevId: 585629699
Change-Id: I12dbd235dee49223fa7b1a097f04561da69550a0
2023-11-27 06:07:53 -08:00
Yuval Tassa ca046cbf64 Fix rendering bug in changelog.
PiperOrigin-RevId: 585627863
Change-Id: I238b9d7eb13dbc8660f15f45efe6a84ccbb84c66
2023-11-27 05:59:53 -08:00
Yuval Tassa 25ddb3e6e8 simulate: Add states to history when stepping with right arrow key.
PiperOrigin-RevId: 585613870
Change-Id: I7fb051946e8a91a900442e3d7048dfa8b8bd7c5c
2023-11-27 04:45:51 -08:00
Alessio Quaglino eb9568a48b Add frame element to MJCF.
PiperOrigin-RevId: 585598244
Change-Id: I4c06be3dd586dab5a4458f05faaf1e7f2b615458
2023-11-27 03:32:18 -08:00