Taylor Howell
a51f346059
Use sparse (uncompressed) actuator_moment in mj_transmission.
...
PiperOrigin-RevId: 692179704
Change-Id: Ic30ac5a98dc13de2028e378df65dc88ba3912bf5
2024-11-01 08:06:28 -07:00
Yuval Tassa
c9f78ad8a8
Rename nnzJ to nJ in mjData.
...
This naming is more consistent.
PiperOrigin-RevId: 691858223
Change-Id: Ife3db822afa0b51b30d0792548b35b3742da388a
2024-10-31 10:43:10 -07:00
Kyle Bayes
18682aac6a
Fix function definition formatting.
...
PiperOrigin-RevId: 691782530
Change-Id: Ib1611285e77e274b17074d5f09ede00cdc0c6f0f
2024-10-31 06:45:41 -07:00
Alessio Quaglino
94bbf297fc
Replace flex_xvert0 with flex_vert0
...
`flex_xvert0` stored the Cartesian position of the vertices in `qpos0`. This array was unused, so it is now replaced with `flex_vert0`, which still contains the positions of the vertices, but normalized on the bounding box of the flex so that the coordinates are in `[0,1]^m->flex_dim`. This will be useful in the future for using different interpolation methods for computing flex deformations.
PiperOrigin-RevId: 691779361
Change-Id: I5c4223103cd4558f4e268fe3e8d8177541e4754f
2024-10-31 06:30:36 -07:00
Yuval Tassa
70d944b458
micro-optimization to mju_mulMatTVecSparse
...
PiperOrigin-RevId: 691431137
Change-Id: I95f94ff38ae911194b21aa220af35c7374af9739
2024-10-30 08:41:18 -07:00
Alessio Quaglino
b941e994d9
Move keyframe resizing from compilation to attach (mjCModel::operator+=).
...
This allows to resize parent keyframes also when the child has no keyframes.
PiperOrigin-RevId: 691045299
Change-Id: I3ab6509b13b5754e937ec77daf9efe697cabf1bc
2024-10-29 09:17:55 -07:00
Taylor Howell
ce5f8b4728
Fix typo in mju_muscleDynamics comments.
...
PiperOrigin-RevId: 690949399
Change-Id: I8102fb72cce909786eab0771467c7f6f751792bf
2024-10-29 03:31:28 -07:00
Yuval Tassa
864b805a6e
Fix multiple bugs related to connect and weld constraints with site semantics. Fixes #2179
...
The introduction of site specification to connects and welds in 3.2.3 conditionally changed the semantics of `mjData.eq_obj1id` and `mjData.eq_obj2id`. These changes were not properly propagated in several places leading to incorrect computations of constraint inertia, readings of affected force/torque sensors and runtime enabling/disabling of such constraints.
PiperOrigin-RevId: 690670420
Change-Id: I55ee8a013cbee8457f8d6c7f33c2981aedafbab6
2024-10-28 10:44:04 -07:00
Copybara-Service
d95befaddd
Merge pull request #2180 from pschmutz:schmutz/error_handling_when_loading_plugins
...
PiperOrigin-RevId: 690567811
Change-Id: I2d2c4e37e74ab4d97c0add5633feb766ef66dd08
2024-10-28 05:11:14 -07:00
Yuval Tassa
d8494fef3b
Remove deprecated mjv_makeConnector function.
...
PiperOrigin-RevId: 690563333
Change-Id: Ice9c6b6cf41de8a55fa361477f9aee9181d50184
2024-10-28 04:51:47 -07:00
Taylor Howell
a36f2cccb6
Add nnz argument for size of allocated memory to mju_dense2sparse and check if this number is too small for number of non-zeros.
...
PiperOrigin-RevId: 690545825
Change-Id: I0e31cb907a1151cb2e4766d5f0cdfecb5629a2a6
2024-10-28 03:46:50 -07:00
Yuval Tassa
7dc8aef807
Remove the convexhull compiler option.
...
PiperOrigin-RevId: 690307675
Change-Id: I62d8213579ad07296ca96de004d39ae012174aa4
2024-10-27 04:31:10 -07:00
Yuval Tassa
61cb552f8a
Refactor PBR texture layers from separate sub-elements to a single layer sub-element.
...
Add new element to PyMJCF schema.
PiperOrigin-RevId: 690115286
Change-Id: I7bb3f184cb321ca96037b2ca0ee160efef37469d
2024-10-26 07:41:38 -07:00
Philipp Schmutz
7cf457286d
Print error instead of failing silently when loading plugins
...
Previously the return value of dlopen was ignored, meaning a failed load of a shared library would stay unnoticed
2024-10-26 16:22:47 +02:00
Yuval Tassa
a3ea01e57e
Remove deprecated mju_rotVecMat and mju_rotVecMatT functions.
...
PiperOrigin-RevId: 689405782
Change-Id: I0281376d5d6f5c31ea2603d61c03c7b94aaa6312
2024-10-24 09:15:23 -07:00
Alessio Quaglino
159f23e6b4
Remember compiler options during attach.
...
Note:
- Move compiler options into `mjsCompiler` struct.
- The compiler options from the attached model are not written by mj_SaveXML.
PiperOrigin-RevId: 689391440
Change-Id: I1d63c146a32f87c737b7a55b64a54b0ffe3aecc9
2024-10-24 08:31:15 -07:00
Kyle Bayes
1043633cc3
Remove arbitrary limit of a 1000 elements from certain attributes. Fixes #2166 .
...
PiperOrigin-RevId: 689343609
Change-Id: I7cbf5007884433807c76c6c309cb4a858479d34d
2024-10-24 05:37:17 -07:00
Alessio Quaglino
ed7655cf97
Store a copy of the attached specs in the destination spec.
...
PiperOrigin-RevId: 689013340
Change-Id: I2cb7a1f3850f0e3592834b355d35dcc2cd8f150f
2024-10-23 10:20:42 -07:00
Alessio Quaglino
d17d9e835c
Do not delete attached specs after compilation.
...
Also, copy them when copying the spec.
PiperOrigin-RevId: 688998464
Change-Id: I7229fd8032eafede582194ccf73ab4160fe06768
2024-10-23 09:42:05 -07:00
Yuval Tassa
e14aebfd16
Expose mju_sparse2dense to public API.
...
PiperOrigin-RevId: 688985153
Change-Id: I9559f1d47363d0afada80c86abdc729cd1910b63
2024-10-23 09:01:25 -07:00
Alessio Quaglino
b598d79b3f
Move mesh inertia specification from global <compiler> to <asset/mesh>.
...
Three options:
- Convex: Use convex hull
- Exact: Use exact geometry (requires watertight mesh)
- Legacy: Legacy approximation (deprecated)
Fixes #2152
PiperOrigin-RevId: 688949900
Change-Id: I4537f343db917195c6fd58d517b189d5ee3be1cd
2024-10-23 07:06:31 -07:00
Kyle Bayes
0c97dcf1fd
Avoid overflowing the stack when allocating memory for polytope in EPA.
...
PiperOrigin-RevId: 688641864
Change-Id: I3eef7e821ffbfa8d97a946ecf86d098cb4f0c233
2024-10-22 12:11:22 -07:00
Alessio Quaglino
4a3f77dd1f
Add missing default namespaces.
...
Fixes #2162 .
PiperOrigin-RevId: 688575676
Change-Id: I6c43e33ebead68dece0f779e6f031e90a5e19096
2024-10-22 09:16:31 -07:00
Kyle Bayes
708fd83a49
Remove goto statement from engine collision code.
...
PiperOrigin-RevId: 688539516
Change-Id: I29b5dd39acccde59df2dbcaf5e866eb6a0406c43
2024-10-22 07:22:18 -07:00
Alessio Quaglino
bfa78614c8
Require prefix for the attach tag.
...
For `mjs_attachFrame` and `mjs_attachBody`, require either a prefix or suffix.
It is tempting for users to not use a prefix (see #2162 ), but this causes issues. For example, it creates a duplicate "main" default class in the parent as a child of the already existing "main" default.
PiperOrigin-RevId: 688535755
Change-Id: I653181ca35943f1e4eb89c70fca8b5289818324e
2024-10-22 07:08:33 -07:00
Taylor Howell
94e9912d28
Add mju_mulMatTVecSparse to multiply transposed sparse matrix and dense vector.
...
PiperOrigin-RevId: 688535240
Change-Id: I0bacf1e911cde99014b2dcb0a1434e61a4f41d51
2024-10-22 07:06:29 -07:00
Kyle Bayes
2b0629d75f
Replace mjQUICKSORT with faster, native sorting function. fixes #1638
...
PiperOrigin-RevId: 688519096
Change-Id: I05ab1576703c2458968ef81915ac682a8beac391
2024-10-22 06:05:12 -07:00
Alessio Quaglino
9e1aa37b55
Do not self-attach custom tags.
...
Fixes #2162 .
PiperOrigin-RevId: 688518165
Change-Id: Iad90e159514c96635676a8dd53fca41e3998d8fc
2024-10-22 06:04:07 -07:00
Yuval Tassa
aa91f3c047
Fix bug in slider-crank transmission.
...
The associated row in `actuator_moment` was not cleared before being updated.
PiperOrigin-RevId: 688207085
Change-Id: I2f925e984c5c493e64ead66667aef57c4844acfe
2024-10-21 11:21:15 -07:00
Alessio Quaglino
a70aea918c
Prevent duplicated pairs in active_pugins vector.
...
Fixes #2150
PiperOrigin-RevId: 688164615
Change-Id: I9a5434a9dda28a399ffccfe0c4b31fa64400b85f
2024-10-21 09:30:27 -07:00
Alessio Quaglino
dcf2816543
Remove copy_back from Python bindings and mj_copyBack from the C API.
...
PiperOrigin-RevId: 687377331
Change-Id: I355493d92857418b08b5aa90ea38cebe5c475314
2024-10-18 11:55:04 -07:00
Google DeepMind
ffdb800e45
Update the MuJoCo version for the 3.2.5 release following the 3.2.4 release.
...
PiperOrigin-RevId: 686641388
Change-Id: I68d5183c9d369b7617f692ab97c12c53f0d2504c
2024-10-16 14:24:06 -07:00
Alessio Quaglino
8740533644
Check obj and ref types before casting them to a geom.
...
PiperOrigin-RevId: 686616350
Change-Id: I43b14344df6324b371c6bb2447c63197b88178d5
2024-10-16 13:16:01 -07:00
Gabe Oppenheimer
c2024ef6d1
Update the MuJoCo version for the 3.2.4 release.
...
PiperOrigin-RevId: 686261295
Change-Id: Ib59e44a6829a79fd480f2822a68cb05f94c38732
2024-10-15 15:34:09 -07:00
Alessio Quaglino
11af1e2a95
Fix a bug in mj_recompile.
...
The qposadr_ and dofadr_ variables of the joints were not being reset to -1 when a joint is copied. This could lead to errors when calling mj_recompile after attaching a compiled spec.
PiperOrigin-RevId: 686152004
Change-Id: I9e058089ce87ea0d8e51a7f43475bc48c6527a26
2024-10-15 10:24:32 -07:00
Yuval Tassa
0ffaeb4d56
Improve comments in mju_cholFactorNNZ, clarify that this function reads from the upper triangle of the source matrix.
...
PiperOrigin-RevId: 686113654
Change-Id: I029f9279d177f4cb9ff60396a26d64821aee3a6c
2024-10-15 08:26:07 -07:00
Kyle Bayes
5a95d601ed
Use GJK for geom distance when the nativeccd flag is enabled.
...
PiperOrigin-RevId: 686035648
Change-Id: Ib6121394b420df4ba431c38443479d33eeaf1dd9
2024-10-15 03:25:18 -07:00
Yuval Tassa
400d2edc21
Clean up mj_transmission.
...
PiperOrigin-RevId: 685770636
Change-Id: I03d46d136118a5e6da61f6924ccae65bf0d81dfb
2024-10-14 11:15:06 -07:00
Kyle Bayes
8d84b5f693
Disable hfields for collision sensors.
...
PiperOrigin-RevId: 685730321
Change-Id: Ib1d4a90b7b31ca388e018076a274e25c40409080
2024-10-14 09:19:11 -07:00
Yuval Tassa
ee7b994021
Remove Newton Cholesky factor from mjData arena, rollback of b66da3d369.
...
PiperOrigin-RevId: 685726867
Change-Id: Ic2afd0dd35e38f403164d2cbe4618286abfa51ab
2024-10-14 09:07:22 -07:00
Yuval Tassa
7ec94f46d4
Refactor Newton solver: move Hessian from arena back to the stack.
...
The changes in 9a0dc20821 , moving the Hessian from the stack to the arena, should be rolled back: they prevent future threading over islands. Unlike the stack, arena allocations are not thread-friendly. The reason for the original move was to save memory, but the savings are small: `O(ctx->nH)` and only linear in `nv`. The significant reduction of the Cholesky factor, from quadratic in `nv` to quadratic in the largest dof island — the reduction afforded by 2dd518734f — remains in place.
Also refactor and improve readability.
PiperOrigin-RevId: 685717356
Change-Id: Ia9ec3e44a62d459a3b9cffb578cf6479d5aa1d7f
2024-10-14 08:34:16 -07:00
Alessio Quaglino
1e7c109887
Raise warning when attaching a spec with pending keyframes to a different spec.
...
PiperOrigin-RevId: 685677622
Change-Id: Iba522c523ebd2afe64d6ab28c6b6b4b3cd399cf8
2024-10-14 05:54:18 -07:00
Alessio Quaglino
c84f35b425
Do not delete pending keyframes during body detachment.
...
PiperOrigin-RevId: 685670895
Change-Id: Iadd0ba8ca7e74a280559168ac0ac855405a1cfd9
2024-10-14 05:23:46 -07:00
Alessio Quaglino
766cd20273
Add mjs_bodyToFrame() to convert a body to a frame.
...
Also add test for attaching the world body.
PiperOrigin-RevId: 685603933
Change-Id: I3cfe7d226d6f032b5a587e44d0f4f18207977188
2024-10-14 00:39:20 -07:00
Alessio Quaglino
52a0149cd1
Resizes keyframes before storing them during attach/detach.
...
Improve keyframe tests.
PiperOrigin-RevId: 685450257
Change-Id: I97aa129c4d7a66f613290605b85657e8081700b6
2024-10-13 10:02:35 -07:00
Taylor Howell
99259eb0d3
Fix typos in engine_ray.c.
...
PiperOrigin-RevId: 685273762
Change-Id: I6812a83ef2d84fa07a42812acb87c363a3e1a11d
2024-10-12 16:05:43 -07:00
Taylor Howell
78ade58aff
Remove rootid from touch sensor (unused).
...
PiperOrigin-RevId: 685196948
Change-Id: Ifd574165717f07a58a13ae187bc1c63527c986e7
2024-10-12 08:10:09 -07:00
Yuval Tassa
5fe2b88726
Print ASCII sparse matrix structures in mj_printData.
...
Also: don't print sparse matrices if they have more than 300 rows.
PiperOrigin-RevId: 684843230
Change-Id: If91d0b56cbbb6565904c3ee55857999e21b0cc62
2024-10-11 08:17:25 -07:00
Kyle Bayes
70d6655434
Add faster support functions for NativeCCD.
...
PiperOrigin-RevId: 684809392
Change-Id: I5125d4bb74c167d370aa919befba9d356c7162da
2024-10-11 05:59:30 -07:00
Yuval Tassa
2dd518734f
Stop over-allocating memory in Newton solver.
...
PiperOrigin-RevId: 684797464
Change-Id: I3389416cb69a8564b5119f6e3944b579893ea511
2024-10-11 05:09:33 -07:00