Commit Graph

518 Commits

Author SHA1 Message Date
Yuval Tassa 6e02c19ebb Print contacting geom names, if non-empty, in mj_printData output.
PiperOrigin-RevId: 502340142
Change-Id: I6359a1ea8fb515e13cb434e31d9592b9d6ce9181
2023-01-16 03:08:33 -08:00
Tom Erez f3c966796f Allow models without numerical suffixes.
This is important for MJPC, where some element special names (e.g., a site called "trace0", or different custom numeric fields) are used.

PiperOrigin-RevId: 502338391
Change-Id: I632b5d633c92b82b60160daeeb169693225640a3
2023-01-16 02:59:11 -08:00
Saran Tunyasuvunakool d022cd1a31 Fix broken launch_repl in the Python viewer.
The REPL functionality was broken in 9fcf3b0c2e.

PiperOrigin-RevId: 501818153
Change-Id: I3fe2f14d78839e63deb43c1017527e7a1cf79e3c
2023-01-13 04:59:22 -08:00
Kyle Bayes deb14dc081 Autogenerate functions.rst for API reference docs.
PiperOrigin-RevId: 501496950
Change-Id: I92ab013e6acb4d6772eb5dcf56740105908afc97
2023-01-12 01:34:28 -08:00
Kyle Bayes 15c2e0362a Split functions API from APIreference.rst.
PiperOrigin-RevId: 501209457
Change-Id: Ia77fe988fb34e323a2c66503903c4618f5fb3087
2023-01-11 01:13:37 -08:00
Yuval Tassa 5b942329d2 Fix various typos.
PiperOrigin-RevId: 500951615
Change-Id: I3c61ef4328d77457d12091bbf75514872b53c2d0
2023-01-10 03:59:27 -08:00
Yuval Tassa adf71cc6b4 Improve mesh-fitting image in changelog.
PiperOrigin-RevId: 500782543
Change-Id: Iecec45abd3cb1e5a06df58ae32ebe1998584024a
2023-01-09 12:40:10 -08:00
DeepMind 703b33c064 Add geom names to URDF parsing in MuJoCo.
Fixes #566

PiperOrigin-RevId: 500750288
Change-Id: I00f94ee37bb2f15be59df3933d0d4dba583f0921
2023-01-09 10:34:22 -08:00
Alessio Quaglino 19b6c70e13 Use global coordinates for computing the frame position of a primitive geom fitted to a mesh.
PiperOrigin-RevId: 500720200
Change-Id: I0a564aff1fe6943002db14f46f789cfdaef4d2de
2023-01-09 08:29:27 -08:00
Yuval Tassa f19d5d2f28 Fix typo in mujoco.h
PiperOrigin-RevId: 500675056
Change-Id: Ie4958609563b2826cc4965b42ad4d22248c733ef
2023-01-09 04:04:25 -08:00
Saran Tunyasuvunakool 1215067f5c Add an option in mjrContext for mjr_readPixels output format.
PiperOrigin-RevId: 500342924
Change-Id: I43e8c6208db341e2bdbef10382b7293c35bdca65
2023-01-07 00:11:01 -08:00
Saran Tunyasuvunakool e40775fab3 Abstract out GLFW calls from Simulate.
PiperOrigin-RevId: 500129478
Change-Id: I7ba998e20439575ad9a3fe1a866c3db4c36b9328
2023-01-06 02:45:56 -08:00
Kyle Bayes 048bd43724 Fix various typos.
PiperOrigin-RevId: 499888205
Change-Id: I38ccf9edb2a745fe8087f14b67ecccca872f7743
2023-01-05 08:29:49 -08:00
Saran Tunyasuvunakool 6824cd50e2 Update MJBindings.cs to correctly reflect pointer-to-pointer types.
PiperOrigin-RevId: 499881915
Change-Id: Ibd25d8e38258c7d1372a066dadbffcf4c1dd2d6b
2023-01-05 08:10:54 -08:00
Nimrod Gileadi f85f3fba2f Avoid duplicate contact points in compound bodies.
Sometimes broadphase returns the same body pair multiple times. In those cases, avoid creating every contact twice.

PiperOrigin-RevId: 499869235
Change-Id: I58606168b0723d40b4fdd43b1fafad79bf35d76d
2023-01-05 07:28:05 -08:00
Kyle Bayes 0c463366a0 Reduce internal names hash map from factor of 1 to 0.5.
PiperOrigin-RevId: 499762072
Change-Id: Id4ea606b5c534c55665485c9f71412523164d2ed
2023-01-05 01:29:14 -08:00
Yuval Tassa 928eb7a067 Add link from "build from source" sections to GitHub CI.
PiperOrigin-RevId: 499737486
Change-Id: If9c5fa730166bfc73b828c87cf4ba4ddb9ace28c
2023-01-04 23:59:10 -08:00
Tom Erez ba9229cad5 Remove test for MjVfs read.
The c# library never reads from MjVfs files, so this test is superfluous (and flaky).

PiperOrigin-RevId: 499490518
Change-Id: I417959b5374c5ede29544ee3f463928513e28d07
2023-01-04 08:22:54 -08:00
Kyle Bayes f1007df013 Implement hash map for mj_name2id using djb2 and linear probing.
PiperOrigin-RevId: 499485127
Change-Id: I5aed6549db18b92d7c8a3b7590e50a00ce13a439
2023-01-04 07:57:55 -08:00
Kyle Bayes 5261cceb30 Fix typo in engine_io.c.
PiperOrigin-RevId: 499422793
Change-Id: Ic3a0d6dcc9119041267555efd6a8addb944d6639
2023-01-04 01:35:28 -08:00
Yuval Tassa 4bc76c93ae Remove "name" attribute from plugin specifiers.
PiperOrigin-RevId: 499187319
Change-Id: I0755a071eb4eee917fdf32db49a47fd16afa58f9
2023-01-03 05:03:20 -08:00
Tom Erez 45184bfa55 Fix Typo.
PiperOrigin-RevId: 499185052
Change-Id: I159271a229c90f38836d607511459edbe1d501bb
2023-01-03 04:49:48 -08:00
Saran Tunyasuvunakool 5fe97403c9 Remove source building instructions from python/README.md.
Most users should be fine with just `pip install mujoco`, so it seems better to keep the installation section in the README succinct to prevent confusion.

Advanced users who need to build from source are referred to our documentation, which currently just duplicates the same information.

PiperOrigin-RevId: 499182819
Change-Id: I181fee93c3d2e05b0ca8462bb364f94cf1065517
2023-01-03 04:35:31 -08:00
Tom Erez 69739426f1 Use scalar Angle to compare quaternions.
The Vector4 comparator couldn't know that q==-q.

PiperOrigin-RevId: 498947861
Change-Id: Ife9efeb369c794eedbef80829e40057794a334ee
2023-01-01 20:01:48 -08:00
Kevin Zakka a173e01f42 Prevent division by zero in Ornstein–Uhlenbeck control noise.
PiperOrigin-RevId: 498753494
Change-Id: Ib43e165a4da524c12fab4ea05848b084b2e7713c
2022-12-31 10:29:03 -08:00
Tom Erez eb8389fead Find MjScene at OnEnable: ensure MuJoCo compilation happens only once at startup.
PiperOrigin-RevId: 498655077
Change-Id: Ibed8f36a880426063b7729fc66b15c67adcc9a65
2022-12-30 18:37:59 -08:00
Tom Erez f78ebeab96 Add post-compile and pre-destroy events to MjScene.
PiperOrigin-RevId: 498516529
Change-Id: I52dbf135e3260ca2999069bcb9f9b9ad648595d2
2022-12-29 22:43:11 -08:00
Yuval Tassa 95b9a0f215 Fix typo, improve error message.
PiperOrigin-RevId: 498473694
Change-Id: I9b04df14f4afbe7148c3083da26451020bd2ebc9
2022-12-29 17:15:10 -08:00
Yuval Tassa 68ffbffc53 Fix typo.
PiperOrigin-RevId: 497330766
Change-Id: Ie8ce4968407498ca4398995734e7868b7af72c6f
2022-12-23 02:00:33 -08:00
Tom Erez 6a58fd1522 Clean-up test files.
Also, don't add a Global Settings component at import if the xml doesn't have any global settings (option/size/custom).

PiperOrigin-RevId: 495950899
Change-Id: I6599e8ea3f3a82729fc5c974fd7ced8eb93b277e
2022-12-16 13:39:28 -08:00
Yuval Tassa 69c74f850e Hierarchical restructuring of docs Programming chapter
PiperOrigin-RevId: 495941670
Change-Id: I7f92d90fd58b9e22b59c54861277be60cb43323d
2022-12-16 12:56:47 -08:00
Copybara-Service 4d91866e98 Merge pull request #652 from Balint-H:fix/unity-scene-tranisition
PiperOrigin-RevId: 495876985
Change-Id: I9880aa6bd2fc696509e518449a35a69457d92ba4
2022-12-16 08:13:03 -08:00
Saran Tunyasuvunakool 725b45b577 Internal Python bindings cleanup.
PiperOrigin-RevId: 495868304
Change-Id: Ib9cfe5f7a1d49126659176207bd6b4a314f8516a
2022-12-16 07:22:48 -08:00
Tom Erez 189349f421 Don't add an empty "user" attribute to user sensors.
This fixes the broken TAP tests.

PiperOrigin-RevId: 495867491
Change-Id: I740651ed0dd8d1c84053a48f3fca577b6024bf95
2022-12-16 07:17:42 -08:00
Tom Erez f70403d00a Add support for global custom numeric fields.
PiperOrigin-RevId: 495865065
Change-Id: I59ed65e84a0bcaa90220b938ed34fdc26165aa09
2022-12-16 07:03:31 -08:00
Copybara-Service 516d13d678 Merge pull request #657 from Balint-H:fix/spring-import-units
PiperOrigin-RevId: 495845558
Change-Id: I391a89403b8e5be170ddefe36d29dbd916970995
2022-12-16 05:00:07 -08:00
Saran Tunyasuvunakool 58b623ae5c Update README badge URL.
https://github.com/badges/shields/issues/8671

PiperOrigin-RevId: 495835738
Change-Id: I92199979b30b3f5ba90c5da82faf3bcb0967f461
2022-12-16 03:57:48 -08:00
Bálint Hodossy a0ab1940bf Fix ignored units of springref 2022-12-15 15:36:14 +00:00
Tom Erez e95b0c0eaf Add anchor support for connect constraint components.
Fixes #647

PiperOrigin-RevId: 495587232
Change-Id: I528a69dabbc1ac9a12f9ab7c16716e3d69c635e2
2022-12-15 07:25:59 -08:00
Kevin Zakka bc02c2455e Sensor plugin parsing: Ensure sensor reftype is only assigned if a value in the XML exists.
PiperOrigin-RevId: 495314131
Change-Id: I5f955c435474de1dd1d75f7a7492e3a21ea9d289
2022-12-14 07:57:29 -08:00
Bálint Hodossy aec125fb4e Check whether MjScene exists in components' OnDisable() 2022-12-14 13:38:36 +00:00
Saran Tunyasuvunakool 05216f183c Fix broken test on MSVC.
Test was broken by 2e6af64b31.

PiperOrigin-RevId: 495196716
Change-Id: I0402b05da2778c54c2761efe5d9977fd091cddd6
2022-12-13 20:22:50 -08:00
Yuval Tassa 30b4309af9 Rename mjpPlugin.capabilities -> mjpPlugin.capabilityflags
PiperOrigin-RevId: 495080532
Change-Id: I81743472b816a331890a7cb05bfb7a89ebf07ff9
2022-12-13 11:33:27 -08:00
Saran Tunyasuvunakool 5c021d042b Modify signature of plugin reset callback.
The `reset` function is called inside `mj_resetData`, before any physics forwarding call has been made. It is therefore an error to read anything from mjData at this stage.

The only valid operation on mjData during `reset` is for a plugin to write into its own state variable slots and data struct. We modify the function signature to only provide access to these.

PiperOrigin-RevId: 495032492
Change-Id: Ic6d2967d2571a9083cbca1ba239ca70a8a51f474
2022-12-13 08:41:35 -08:00
Saran Tunyasuvunakool 2e6af64b31 Change mj_versionString test to not rely on a golden value.
PiperOrigin-RevId: 495026376
Change-Id: I378d2cff1edfe4d49c1bd7c131d92502d0a6b5b2
2022-12-13 08:16:55 -08:00
Saran Tunyasuvunakool 093125c2bd Fix incorrect plugin error message during model compilation.
PiperOrigin-RevId: 495023028
Change-Id: Iec0fa213235793c1b96409d86b9e2af1055404b2
2022-12-13 08:03:36 -08:00
Alessio Quaglino 3de2873883 Add deprecation warning for the Rope Composite type.
PiperOrigin-RevId: 494985209
Change-Id: I6ce7ca2aeae6f1e798bd4bda9b755852add26a36
2022-12-13 04:35:48 -08:00
Nimrod Gileadi 7076da6909 Correctly validate the size of user sensors in mj_validateReference.
PiperOrigin-RevId: 494877162
Change-Id: I0a070d7813efea6216d15270f62b6009c55e1a54
2022-12-12 17:49:06 -08:00
Tom Erez 21f10ce1b6 Add user sensor bindings.
Stop force-setting nusersensor, instead allow MuJoCo to infer the size.

PiperOrigin-RevId: 494783883
Change-Id: Ia2a1b1803b2904f2dded7b790d01eb6f1920dbaf
2022-12-12 11:43:00 -08:00
Tom Erez 7a248a8bde Rename bindings file for consistency.
PiperOrigin-RevId: 494779230
Change-Id: I693a0e389febc51276bde565bbbfc87c241f15e0
2022-12-12 11:24:12 -08:00