Commit Graph

796 Commits

Author SHA1 Message Date
Yuval Tassa 455b1cd2e2 Add spaces around comparison operators in engine source files.
PiperOrigin-RevId: 535989348
Change-Id: I883f7e82351299933c49b35a31842b5d8d6aea04
2023-05-28 05:02:34 -07:00
Yuval Tassa d40c395917 Add Visualization tab to simulate.
Also:
- Increased label width in mjUI tight theme spacing.
- Added `mjITEM_EDITFLOAT` for editing float values.
- Move mjUI numpad key codes to header file.
PiperOrigin-RevId: 535839953
Change-Id: Ibdc0a9a20be514caa5b487211212ed6f5b8a6ba9
2023-05-27 05:08:15 -07:00
Yuval Tassa ea6789b376 Add emoji to README.
PiperOrigin-RevId: 535670105
Change-Id: Ic9bf3e029eb5db8aa30a48c64d3f0d5fdb814f89
2023-05-26 11:27:28 -07:00
Saran Tunyasuvunakool f887c1e928 Add ASAN and MSAN instrumentation for arena and mjData stack.
PiperOrigin-RevId: 535635490
Change-Id: Ia1e58771bae25bf72c861f57452fb8faa2b918fb
2023-05-26 09:17:26 -07:00
Saran Tunyasuvunakool 1d79657512 Fix out-of-bound read in mju_combineSparseCount.
PiperOrigin-RevId: 535615505
Change-Id: I740d4f50b46ec2a1cd1a5a615fb4312f1bbebd94
2023-05-26 07:44:47 -07:00
Yuval Tassa cce7fb04d1 Fix out of bounds write in clampedDiff in engine_derivative_fd.c
PiperOrigin-RevId: 535234007
Change-Id: I1ca54df1324346cd250409125939fdf6f63cee04
2023-05-25 06:25:08 -07:00
Yuval Tassa c66d79409c Change mj_ray behaviour to match geom visualisation conventions:
- Planes and height-fields respect `mj_ray`'s `geom_group` argument.
- The `flg_static` argument now applies to all static geoms, not only those directly in the world body.

Before this change:
- Rays always intersected with height fields and planes, unless `flg_static` was set to 0.
- `flg_static` only applied to static geoms that were direct children of the world, but not geoms that were children of static bodies.

PiperOrigin-RevId: 534969091
Change-Id: I8dc7c320c63d6af95709b9f5e83a3c50e1c199fa
2023-05-24 13:52:21 -07:00
Saran Tunyasuvunakool 55c7f45dc5 Fix sparse matmul logic in addJTBJSparse.
Also rename arguments and loop variables in `addJTBJSparse` for additional clarity.

PiperOrigin-RevId: 534908360
Change-Id: I143ef5aef7ff90091369d408740f7f44d9e19378
2023-05-24 11:02:35 -07:00
Yuval Tassa d82465d710 Fix use of uninitialised memory.
PiperOrigin-RevId: 534783070
Change-Id: I4fddc983a8ac7213049366d909c57c303ab0e521
2023-05-24 04:39:57 -07:00
Alessio Quaglino 03d6d27f64 Use mesh BVH for speeding up ray mesh intersection.
PiperOrigin-RevId: 534141245
Change-Id: I9f5a71ea059a1a232fd2910d1efc0506ab6dbef3
2023-05-22 12:05:20 -07:00
Saran Tunyasuvunakool fbbdf70401 Make XMLWriterLocaleTest hold a copy of the old locale string.
The rationale is the same as in 0d0a41d549. XMLWriterLocaleTest still sporadically fails with a stack buffer overflow error when built with MSVC 2019 prior to this change.

PiperOrigin-RevId: 534035241
Change-Id: I1c50457e386724021b8d97ab1fb9cc2ece795292
2023-05-22 05:34:24 -07:00
Yuval Tassa bb8044e5f3 Set minimum tree slider depth to 0.
PiperOrigin-RevId: 534003561
Change-Id: I42ccd0eab15b5a3c9852f8944c6b191f7999c113
2023-05-22 02:39:58 -07:00
Yuval Tassa e338034995 Fix links in README.
PiperOrigin-RevId: 533444487
Change-Id: Ifc1743095f1c4e204360689c681066ca89944804
2023-05-19 07:05:17 -07:00
Yuval Tassa f5936eac7b - Mention mujoco_wasm in README.
- Move Documentation and Getting Started above Installation.
- Delete link to the acquisition and open-sourcing announcements.

PiperOrigin-RevId: 533434989
Change-Id: I5ac9281cee953c46d618d63fdf9bfd7d39e8f264
2023-05-19 06:11:53 -07:00
Yuval Tassa 20e06ba353 Add missing braces.
PiperOrigin-RevId: 533419351
Change-Id: Iad54f6cb6d63c05e6a2f81526b22a914e2a23ba2
2023-05-19 04:35:12 -07:00
Alessio Quaglino a09246c095 Removed key for visualizing the mesh tree.
PiperOrigin-RevId: 533126358
Change-Id: I8b30691c78cbae4b8ad44ac16fb7567b2a131dcf
2023-05-18 07:52:34 -07:00
Yuval Tassa eca0df4c6c Improve formatting of cubelet vertices.
PiperOrigin-RevId: 533031494
Change-Id: I27b6e9eb17c3ebb1382d0e3d5ccb2402f00fbddc
2023-05-17 23:32:07 -07:00
Kevin Zakka dee9a958b4 Tweak cube XML.
PiperOrigin-RevId: 532851091
Change-Id: Icb089b914874e940985a08f6587c390732431f92
2023-05-17 11:26:57 -07:00
Alessio Quaglino dab49d487c Use mesh BVH for speeding up ray mesh intersection.
PiperOrigin-RevId: 532516008
Change-Id: Ia9cac060279d030221c1a6b4fad457a857701370
2023-05-16 11:10:38 -07:00
Alessio Quaglino 9db444cd46 Fixed texture mapping bug. Before this fix, the first texture coordinate was not correctly processed.
Fixes #859.

PiperOrigin-RevId: 532501028
Change-Id: I1fe9ca470f4d64af606479b91387e43bc56c23dc
2023-05-16 10:25:04 -07:00
Alessio Quaglino 9d1a21f99d Use mesh BVH for speeding up ray mesh intersection.
PiperOrigin-RevId: 532464595
Change-Id: If159c89b93c24e6a7be6310911364cfad7baae81
2023-05-16 08:17:50 -07:00
Yuval Tassa 4ea8218466 If inertia is being visualised, draw body frames at the inertial frame.
PiperOrigin-RevId: 532458388
Change-Id: Ie58cea8dee4215ad9e40ef827361bc3793c8f449
2023-05-16 07:55:34 -07:00
Yuval Tassa b81793371b Fix typo.
PiperOrigin-RevId: 532447706
Change-Id: Icea63f7ebf381906dce03175cdbf16e96c3828d7
2023-05-16 07:09:47 -07:00
Alessio Quaglino fcc825c5e6 Add cutoff argument to mj_multiRay.
PiperOrigin-RevId: 532158635
Change-Id: I70f98be9f781c8281e21aa5c17bd85f3654e9383
2023-05-15 10:44:37 -07:00
Kevin Zakka ca9c55d22b Fix typo in user_mesh.cc.
PiperOrigin-RevId: 532158366
Change-Id: I58cc6d7ff5f0781ea2621768dbcd35442d1b2e9c
2023-05-15 10:43:12 -07:00
Tom Erez 31c265782b add support for implicitfast integrator from GUI.
PiperOrigin-RevId: 532109571
Change-Id: Id9fbfad232ee7fdee8aff486b2d2b9b1b1eab258
2023-05-15 07:50:18 -07:00
Alessio Quaglino 871a2a7c8e Check that all face indices of a mesh exist in the vertex array.
PiperOrigin-RevId: 532049715
Change-Id: Ic42f6ef49f136aa89fb83527db0867afa8be7f08
2023-05-15 02:55:44 -07:00
Nimrod Gileadi 39723891ce Use the correct string length argument to mj_loadXML.
PiperOrigin-RevId: 531941053
Change-Id: Ia85b779b603a673b8e1d6f22d4bc183311204c4b
2023-05-14 14:40:36 -07:00
Yuval Tassa 770b4b363a Added optional smoothing to muscle dynamics:
- `muscle` actuators take a new `tausmooth` attribute (defaults to 0) which when positive, smooths the transition between activation and deactivation timescales.
- `mju_muscleDynamics` takes 3 parameters, adding width of smoothing sigmoid.

PiperOrigin-RevId: 531473354
Change-Id: I8ab6c0289ff04437e798c3ca6edda132a30fcc31
2023-05-12 04:58:53 -07:00
Copybara-Service 777cad52b4 Merge pull request #860 from PeterMitrano:main
PiperOrigin-RevId: 531458260
Change-Id: I551e6c6be5d6a15426e6aa60beb27d64591bc66a
2023-05-12 03:34:33 -07:00
Saran Tunyasuvunakool 0d0a41d549 Fix locale management on Windows.
We are currently passing a value previously returned by setlocale to a later call to setlocale, but the spec says that we should be making a copy of it.

PiperOrigin-RevId: 531300386
Change-Id: I9531cfe738fc71fb26b4140a4129dfe67f5f6112
2023-05-11 14:01:31 -07:00
Kevin Zakka 3d71b160e6 Add 3x3x3 cube to model collection.
PiperOrigin-RevId: 531224451
Change-Id: Ibdfe5b89a5b2895500265199906a364768d606f0
2023-05-11 09:28:18 -07:00
Alessio Quaglino bf81d1e6a5 Fix typo.
PiperOrigin-RevId: 531167948
Change-Id: I5fcfe77fd69a050ef9dd88f748973c4a9233cbdb
2023-05-11 04:55:53 -07:00
Saran Tunyasuvunakool 133b8d0978 Make MuJoCo buildable with Visual Studio 2019 update 7 and earlier.
Also enable MSVC 2019 builds on GitHub Actions.

Fixes #862.

PiperOrigin-RevId: 531167754
Change-Id: I17687fb287c38a7f2245c6f7ba59a22b772e3a8c
2023-05-11 04:54:53 -07:00
Alessio Quaglino 09a8e59824 Create half-edge structure before converting from the C++ array userface to the C array face.
PiperOrigin-RevId: 531161474
Change-Id: I77d425f4b5e52b2e41c6c9a2ef187495fefda5b8
2023-05-11 04:15:59 -07:00
Alessio Quaglino 41a7049920 Use shell inertia to compute mesh aabb and frame if volume is invalid.
PiperOrigin-RevId: 530925161
Change-Id: I94b97efc7198e2b750480df8687e91bc047a6fc9
2023-05-10 09:12:11 -07:00
Peter Mitrano 73fde667a5 fix typos 2023-05-09 20:59:43 +00:00
Alessio Quaglino 1aadef5927 Fix unused variable error from GCC.
PiperOrigin-RevId: 530591696
Change-Id: I0b1d647bb4dc343eca4966ba54a90a992ea9544f
2023-05-09 06:25:37 -07:00
Yuval Tassa b36c611745 Fixes to touch_grid config parsing.
PiperOrigin-RevId: 530561729
Change-Id: I67f6dfd137aa54ce2141e5d5c30b5b888665c4a2
2023-05-09 03:42:06 -07:00
Alessio Quaglino 4c487e07ed Add mesh BVH.
PiperOrigin-RevId: 530559807
Change-Id: Ibdafae22c7c74d15d707f205be73e4a571a6ae10
2023-05-09 03:31:06 -07:00
Yuval Tassa 49066e1794 equivalent but clearer quat-diff call in mj_differentiatePos
PiperOrigin-RevId: 530075836
Change-Id: I3bbe5dec17ccdf53c372bb81087dddde30a24c5c
2023-05-07 02:21:52 -07:00
Yuval Tassa ff1fa84d32 Cosmetic documentation improvements
PiperOrigin-RevId: 530074671
Change-Id: I07e000c9c506ae8532ade10fb731b4e1fc0970ea
2023-05-07 02:10:18 -07:00
Yuval Tassa f204e03575 Fix tendon.xml example model.
PiperOrigin-RevId: 530073629
Change-Id: I1fbfa55bc1ec9bbf11ab5a33771ad56537a16c07
2023-05-07 02:01:44 -07:00
Yuval Tassa 49efa9cc15 Change finite-support mju_sigmoid from a two-quadratic construction to a single quintic with zero 1st and 2nd derivatives at 0 and 1, the boundary of the smooth-support segment.
Note: this function is currently unused in the MuJoCo codebase.
PiperOrigin-RevId: 529969804
Change-Id: I2bddc72916eff67625b806510935bc7f3ce5c770
2023-05-06 09:22:37 -07:00
Copybara-Service 26ff1fc4b5 Merge pull request #304 from traversaro:patch-5
PiperOrigin-RevId: 529843317
Change-Id: Iad4a3df7d8c61f536890f9760e441793d6d884dc
2023-05-05 16:38:02 -07:00
Saran Tunyasuvunakool 496755a55d Fix mju_getfiledir when the path contains a mixture of / and \.
PiperOrigin-RevId: 529754511
Change-Id: Ifce2b86bc339a8cae584db639b7901b270e56384
2023-05-05 10:35:55 -07:00
Yuval Tassa 7998fc7fca Fix typo.
PiperOrigin-RevId: 529719905
Change-Id: I7ad8b333465db5f453b0d6b2ade02fbfc39a96a9
2023-05-05 08:12:11 -07:00
Kyle Bayes 67f0f5154f Add various improvements for resource providers.
PiperOrigin-RevId: 529706437
Change-Id: I20385e031446674584349c301982dbe13b812477
2023-05-05 07:03:49 -07:00
Alessio Quaglino b798f89212 Fix bug with the position of bounding sphere in mj_multiRay.
PiperOrigin-RevId: 529665457
Change-Id: I486a094303b3b26c8067f8be7aca03afbe8e6217
2023-05-05 02:53:11 -07:00
Yuval Tassa e38fb136e7 Shorten title in Programming chapter.
PiperOrigin-RevId: 529505191
Change-Id: I148960357263ce874ec2099ffde63303e56eb52f
2023-05-04 13:51:18 -07:00