Yuval Tassa
51aa375af0
Improvements related to models where joint-actuator relationship is not one-to-one:
...
- Add `joint-actuatorforcerange` for clamping total actuator force at joints. Add `sensor-jointactuatorfrc` for sensing total actuator forces on a single joint.
See [documentation](https://mujoco.readthedocs.io/en/latest//modeling.html#actuator-force-clamping ) for justification and use cases.
- Add simple car model to `model/`.
- Move actuation-related test models into `engine/testdata/actuation/`.
PiperOrigin-RevId: 549355941
Change-Id: I27f6c1f80426d73a2811ef5ae74684a228b2fbd1
2023-07-19 10:29:32 -07:00
Saran Tunyasuvunakool
7603b07a20
Fix broken Linux build in 5fcdae771b.
...
PiperOrigin-RevId: 549338643
Change-Id: Icb2de7aa77ddb5d6c9bbf6a1140ef388ead5368c
2023-07-19 09:27:25 -07:00
Kyle Bayes
5fcdae771b
Add content_type attribute that takes a MIME type to specify the file contents for meshes, hfields, and textures.
...
PiperOrigin-RevId: 549302344
Change-Id: I30a8adfef5b5d87bb20479329f3396892f5137ff
2023-07-19 06:51:36 -07:00
taylor howell
e695a95efb
fix mjd_transitionFD comment
2023-07-14 13:50:57 -07:00
Google DeepMind
8f3c488de8
allow specifying static bodies when parsing URDF
...
PiperOrigin-RevId: 547664406
Change-Id: I4b555431d1877fb7547c6b550387cd4230c2b0c4
2023-07-12 19:42:09 -07:00
Kyle Bayes
242aea93c6
Bump oldest supported MacOS to version 11.
...
PiperOrigin-RevId: 547479684
Change-Id: Idb6a432af0e7872ca087a0c571aafa72e9528818
2023-07-12 06:38:26 -07:00
Yuval Tassa
77b3533d90
Improve mju_cross implementation.
...
- Allow in-place cross product a = a x b using `mju_cross(a, a, b)`.
- Easier for compiler to optimize since tmp cannot alias a or b (verified with godbolt).
PiperOrigin-RevId: 547265908
Change-Id: If965867e08c1bc980e71729e38f6855e32de18b2
2023-07-11 12:35:02 -07:00
Alessio Quaglino
e2677d6057
Check references for BVH data structure.
...
PiperOrigin-RevId: 547175700
Change-Id: I10e47f0c81ad25563d1f149bf4d2310ee515b1be
2023-07-11 06:49:20 -07:00
Kyle Bayes
24c1ec9aec
Add support for printing to stdout in mj_saveLastXML.
...
PiperOrigin-RevId: 546849864
Change-Id: I799ea3fcd723cf036f82ef5c1ef8152c314072dc
2023-07-10 06:08:10 -07:00
Yuval Tassa
5cfbb6ac8b
Add mjd_quatIntegrate, expose mjd_subQuat.
...
PiperOrigin-RevId: 546252926
Change-Id: I7d6b2bd6536e7e8afc368f3c46037c20f6a1cb5e
2023-07-07 05:33:24 -07:00
Alessio Quaglino
46e06c4cac
Add elasticity plugins to xml_native_writer_test. Fixes #961 .
...
PiperOrigin-RevId: 545454207
Change-Id: I4e93499eaa53e5bc8c8afa682986657cef3ac20f
2023-07-04 08:30:30 -07:00
Saran Tunyasuvunakool
2b38148d24
Explicitly zero out cinert of the world body.
...
Values of `cinert` are only set by `mj_comPos` for body 1 and above, which leaves the values for body 0 uninitialized. This triggers a `use-of-uninitialized-value` error under msan when the entire `cinert` array is read.
PiperOrigin-RevId: 545453619
Change-Id: I7bfdb4e4e33677903fc90c6ad070490aa65bf464
2023-07-04 08:26:02 -07:00
Kyle Bayes
95167fab2d
Add utility function for merging directory names with filenames, and fix issue in mj_addfileVFS where directory names without trailing filesystem separators won't append correctly.
...
PiperOrigin-RevId: 545450158
Change-Id: I550394f11ac2837d35f3d869f8718a119a9eac38
2023-07-04 08:09:01 -07:00
Kyle Bayes
82e85e24e5
Fix nv precounting bug for dense allocation in contact constraint.
...
PiperOrigin-RevId: 545441998
Change-Id: I12951d9022d78838a67d8e1d9d80d41b73e7c29d
2023-07-04 07:26:49 -07:00
Yuval Tassa
bce2043762
Tighten const qualifiers in collision functions.
...
PiperOrigin-RevId: 543789453
Change-Id: I929c68b9100a093738c0de6c0965dab4ded1084b
2023-06-27 10:44:58 -07:00
Yuval Tassa
a7021df63e
Add primitive sphere-cylinder collider.
...
PiperOrigin-RevId: 543586615
Change-Id: Icd47123e619f731f16dedfec25d825e44c24c036
2023-06-26 17:25:32 -07:00
Yuval Tassa
1d6d6f33bf
Cosmetic clean-up and a few micro-optimisations for primitive colliders.
...
PiperOrigin-RevId: 543559919
Change-Id: I345ccbdca4303e82d1097a5a4bf9381c9f845617
2023-06-26 15:36:20 -07:00
Yuval Tassa
c50c92ccc8
Add mjv_connector, identical to mjv_makeConnector but with a more convenient "from-to" parameterization.
...
PiperOrigin-RevId: 542343761
Change-Id: I75f5ff3c404a2a9f65dfed706e590efd7b951f6e
2023-06-21 13:19:36 -07:00
Nimrod Gileadi
74747e2ae6
Don't accept NaN geom sizes.
...
PiperOrigin-RevId: 542209911
Change-Id: I80f9728e8e624d19783370ba5072f39624c1bbe7
2023-06-21 04:02:48 -07:00
Kyle Bayes
ac1f41160d
Add engine internal error macro mjERROR to prepend calling function to error function.
...
PiperOrigin-RevId: 541584847
Change-Id: I57447e64375413ee07aa96372a402e1ced59ff4a
2023-06-19 03:29:31 -07:00
DeepMind
b873800ab3
Initial Implementation of MuJoCo Physics Device
...
1) Modifications to MJCModel and URDF parsing to enable loading multiple URDF's
2) Device Skeleton for MuJoCo Physics Device
3) Scene Loading and Modifications
4) State Generation
PiperOrigin-RevId: 539676439
Change-Id: Ic65f812b660319443e74f68acd851dba1435ddca
2023-06-12 09:28:27 -07:00
Yuval Tassa
f67e359532
Add mjtState enum and related mj_stateSize, mj_getState and mj_setState functions.
...
PiperOrigin-RevId: 539667943
Change-Id: I14c34be8ce4c287e529380257b5c5bffc3ab45ce
2023-06-12 08:56:48 -07:00
Kyle Bayes
81d74c56e1
Separate mj_addM into dense and sparse functions.
...
PiperOrigin-RevId: 539066339
Change-Id: Ide3f9644fee46a5fb1a2e79a25be162b929e2421
2023-06-09 06:44:19 -07:00
Yuval Tassa
466c9aca82
Remove mj_activate and mj_deactivate.
...
PiperOrigin-RevId: 538799120
Change-Id: I4d6729131e20ab9ae15c94c221ba83ae5732e942
2023-06-08 08:55:39 -07:00
Yuval Tassa
188b04fba5
Use std::stable_sort in model compiler.
...
PiperOrigin-RevId: 538791034
Change-Id: I6c8eceffeb765a8a9801fee996d6ebf2964d8453
2023-06-08 08:21:34 -07:00
Yuval Tassa
d82f5ce5a4
Add mjContact.solreffriction, mjModel.pair_solreffriction and related implementation, allowing contact reference acceleration to be different for normal and frictional contact directions. This is required for e.g. elastic frictional collisions.
...
PiperOrigin-RevId: 538513357
Change-Id: Id9eb910fe791cf898c712030cb2c0fc481389c91
2023-06-07 09:40:20 -07:00
Yuval Tassa
d1c6561f1c
Add spaces around comparison operators in render/ and ui/ source files.
...
PiperOrigin-RevId: 536001297
Change-Id: Ia0d97bf9f886aea03b8363e4d97e18301520909f
2023-05-28 07:04:49 -07:00
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
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
Alessio Quaglino
a09246c095
Removed key for visualizing the mesh tree.
...
PiperOrigin-RevId: 533126358
Change-Id: I8b30691c78cbae4b8ad44ac16fb7567b2a131dcf
2023-05-18 07:52:34 -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
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
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
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
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