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
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
Yuval Tassa
90bc4b555d
Add box-box collision to collection of collision performance benchmark models.
...
Cosmetic tweaks to existing models.
PiperOrigin-RevId: 688133030
Change-Id: I8085b8288d67b75e1cbcbcac0dfa68fccc7d63ca
2024-10-21 07:45:54 -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
8d84b5f693
Disable hfields for collision sensors.
...
PiperOrigin-RevId: 685730321
Change-Id: Ib1d4a90b7b31ca388e018076a274e25c40409080
2024-10-14 09:19:11 -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
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
Alessio Quaglino
cdb167f275
Add mjs_attachToSite for attaching a body to a site.
...
PiperOrigin-RevId: 684432183
Change-Id: I7100bebfb6521f9dbfbb07f31490b2b9298bf18c
2024-10-10 07:12:49 -07:00
Mohammad Hamid
694bdebc19
Fixed a bug that caused dim to be necessary in flexcomp even when it was inferred from GMSH files.
...
Fixes #2107 .
Co-authored-by: Alessio Quaglino <quaglino@google.com >
PiperOrigin-RevId: 684419740
Change-Id: Ia73e719bd37503563223ed92f4dbe0ae07eef300
2024-10-10 06:20:43 -07:00
Alessio Quaglino
8256546432
Fix bug in xml_native_writer that was causing frames to be skipped.
...
PiperOrigin-RevId: 683721505
Change-Id: I8622f4ea42ecda934fbc805c429de40e7717fdef
2024-10-08 12:23:17 -07:00
Alessio Quaglino
66faba9aa5
Avoid changing semantics of mjsPlugin.name across XML sections.
...
The `extension` section used to discard the plugin name and write the instance name in `plugin.name`, while all of the other sections wrote the instance name in `plugin.instance_name` and optionally the plugin name in `plugin.name` (via the function `OnePlugin`). Now all plugin names are in `plugin.plugin_name` and the instance is written in `plugin.name`, so that it is possible to lookup a plugin via its unique instance name.
PiperOrigin-RevId: 683183804
Change-Id: I179ef5d221143b720db24d745b09e327bf1449ef
2024-10-07 07:57:03 -07:00
Yuval Tassa
3f3fe92860
Remove unused argument in mju_sqrMatTDSparseInit
...
PiperOrigin-RevId: 682375566
Change-Id: If05f5d15a2f8925eee9dd0ebc5d485164d90d787
2024-10-04 10:45:33 -07:00
Alessio Quaglino
42c1718d57
Restore RecompileCompare test that was deactivated by mistake.
...
PiperOrigin-RevId: 682310735
Change-Id: I5edf487b194e195de0ff712ad55c2b198de2ef51
2024-10-04 07:20:13 -07:00
Alessio Quaglino
dfd1f8fefc
Fixed a bug causing an early stop of tree traversal.
...
Fixes #2112 .
PiperOrigin-RevId: 681804470
Change-Id: I15a6f010db1a97931438fa6d8fd1d5cda6863c32
2024-10-03 03:38:17 -07:00
Alessio Quaglino
249c4b3f4f
Prevent attaching models with different eulerseq, autolimits, or angle options.
...
PiperOrigin-RevId: 681801855
Change-Id: Iaf107853797768270319e971a3e318db0703bca0
2024-10-03 03:27:47 -07:00
Alessio Quaglino
36ee89d6da
Copy only referenced plugins.
...
Fixes #2111 .
PiperOrigin-RevId: 681486400
Change-Id: I384ac63fa76b27d6e84d91fa857127c42ff52e34
2024-10-02 09:40:48 -07:00
Alessio Quaglino
dfe8e45101
Namespace plugin instances when attaching.
...
Fixes #2112 .
PiperOrigin-RevId: 681045462
Change-Id: I2c945c5405fcb91e0f9a1b0b1e94f68d174c84ee
2024-10-01 09:14:37 -07:00
Alessio Quaglino
89aea5e217
Add body.find_all() to Python bindings.
...
This enables to generate a list of all body children of a given type.
Also, add recursive option to mjs_firstChild and mjs_nextChild. Fixes #2112 .
PiperOrigin-RevId: 681039348
Change-Id: Iebbb26fd5ec314150206edfdddd88633baa0bec6
2024-10-01 08:57:25 -07:00
Yuval Tassa
62ec802ec1
Tweaks to benchmarks.
...
- Modify parse_benchmark_test to not time the first instance of file loading.
- Improve readability of step_benchmark_test.
PiperOrigin-RevId: 680953562
Change-Id: I4569d1b946ecb49b6590ea313f0b598ffc897888
2024-10-01 04:08:40 -07:00
Alessio Quaglino
6832df3091
Replace mjs_setActivePlugins with mjs_activatePlugin.
...
PiperOrigin-RevId: 680613007
Change-Id: Ic03e0dc42a1f5f083e313672bc6e3ccebadc58b3
2024-09-30 09:46:47 -07:00
Alessio Quaglino
e6e6e3b51b
Copy plugins when attaching a model.
...
Before this CL, the same mjCPlugin objects were referenced by both models.
Fixes #2100 .
PiperOrigin-RevId: 680579479
Change-Id: Ida3459f78f9fa4a942cea31b3d5d3e8da2832feb
2024-09-30 08:08:12 -07:00
Kyle Bayes
43a82e08be
Add benchmark test for collisions.
...
PiperOrigin-RevId: 680554813
Change-Id: I0be5b102d68aa1a54b4ceca6b2bd24fbc519f5df
2024-09-30 06:46:25 -07:00
Alessio Quaglino
40b2ae92e5
Reset pending keyframes in source model after attaching.
...
Fixes #2101 .
PiperOrigin-RevId: 680526395
Change-Id: I3bd06db5231d653b1c5bc1c2ba6b03b52e65f288
2024-09-30 05:05:21 -07:00
Alessio Quaglino
58a49bad96
Add nested keyframes attachment test.
...
This is a no-op change for keyframes but it shows an example of behavior.
Also, fixed two bugs:
- Missing namespace when attaching frames.
- Incorrect body id and subtreedof when attaching a compiled spec. Fixes #2063 .
PiperOrigin-RevId: 680289467
Change-Id: I2ddaa7ad2226fa466ec3bbf74a7553d497bb4bb9
2024-09-29 11:57:56 -07:00
Alessio Quaglino
25e4d75a07
Return attached body/frame in mjs_attachBody/Frame.
...
PiperOrigin-RevId: 679601525
Change-Id: Icdc4616808e14bf0a3ebc17d89392382d084c31b
2024-09-27 08:34:00 -07:00
Taylor Howell
6a6e10d779
Add mju_cholFactorNNZ to compute the number of non-zeros per row for sparse Cholesky factorization.
...
PiperOrigin-RevId: 679553197
Change-Id: I6f92deec347dae97d2e219cfb5376f92e777da1a
2024-09-27 05:39:08 -07:00
Alessio Quaglino
bb6da503dc
Make 3 the default number of channels in mjsTexture.
...
PiperOrigin-RevId: 679521155
Change-Id: Ie6c962e75983c8bf8323170338b3d480be3a1117
2024-09-27 03:33:04 -07:00
Alessio Quaglino
f0d52813b8
Copy joint state to the modified mjSpec when detaching bodies.
...
Fixes #2085 .
PiperOrigin-RevId: 678351210
Change-Id: I2a546877dd50abc7805099f8d5c40807ffe780e6
2024-09-24 12:26:29 -07:00
Kyle Bayes
04f8403d8e
Add unit tests for NativeCCD to produce better test coverage.
...
PiperOrigin-RevId: 677793306
Change-Id: I435865f00553c74d1d0c0fa86d9c41fb1e5497ff
2024-09-23 07:55:39 -07:00
Alessio Quaglino
0ba11b9623
Add plugins list to mjSpec Python API.
...
Fixes #2061 .
PiperOrigin-RevId: 677762985
Change-Id: I8e407373e7b505d9b0f1c023e97c5ea92169bbf6
2024-09-23 06:13:42 -07:00
Yuval Tassa
50f43b8745
Fix various issues with body inertial parsing and compiling.
...
- Add errors in body compiler for incorrect mixing of specifiers.
- Correctly process inertia orientation specifiers.
PiperOrigin-RevId: 676843326
Change-Id: I7e7eb22e25a6769754794f98fad5e0dcc0e5946f
2024-09-20 07:53:42 -07:00
Kyle Bayes
7a92423cf2
Add height fields to list of discrete objects in NativeCCD.
...
PiperOrigin-RevId: 676452215
Change-Id: I5d6a0d1e26ee852c774b44f550c1d0531b7a269b
2024-09-19 09:48:41 -07:00
Alessio Quaglino
4998e7b392
Move flex damping to the engine and remove membrane and solid plugins.
...
PiperOrigin-RevId: 676434954
Change-Id: I24e8dbaa90afcffd613a9cf106ef8b7262195328
2024-09-19 09:01:30 -07:00
Alessio Quaglino
f4381e12a2
Delete plugins when their corresponding objects are deleted, if their instance belonged the object.
...
Fixes #2061 .
PiperOrigin-RevId: 676402701
Change-Id: Ia4807d57a3763e2100702b7e7ec96c300d0a9cfb
2024-09-19 07:21:42 -07:00
Alessio Quaglino
aca4b3324d
Resolve default asset names while attaching a spec.
...
PiperOrigin-RevId: 676053538
Change-Id: I717b87be4bc18a5d9f8e5f2dc071bd93409eea81
2024-09-18 10:58:12 -07:00
Kyle Bayes
bd811a44e7
Remove redundant copying in NativeCCD and refactor code for readability.
...
PiperOrigin-RevId: 675573079
Change-Id: If9f7bc21d9ee7806997f05a8985ebe6b1b3c8332
2024-09-17 08:14:10 -07:00
Yuval Tassa
fb56d70dee
Add model with mixed geoms for CCD performance testing.
...
PiperOrigin-RevId: 675567065
Change-Id: I9629b0757270ca541a96bb64384b5c41e7a9b728
2024-09-17 07:56:35 -07:00
Alessio Quaglino
31abd7900a
Add edge ids to flex elements in mjModel.
...
PiperOrigin-RevId: 675130981
Change-Id: If2ccfb268142d235273b7a50e15740f6399903b2
2024-09-16 06:58:10 -07:00
Alessio Quaglino
b15de2c951
Add elasticity parameters to the schema.
...
PiperOrigin-RevId: 675115200
Change-Id: Ic6608ce61cbb857dca71b3d9cbdac057e8f1ac7a
2024-09-16 05:56:36 -07:00
Alessio Quaglino
015bdeb756
Disallow repeated nameless assets that use the same file, except for URDFs.
...
PiperOrigin-RevId: 675114055
Change-Id: I142811ac2d8ef9e12bb8a06d5f3a2fdac02946da
2024-09-16 05:50:50 -07:00
Taylor Howell
60a1921b34
Add site semantics to weld constraint. Fixes #1896
...
PiperOrigin-RevId: 675112981
Change-Id: Ie4c01440d54116075df89f480591700762892cbd
2024-09-16 05:46:01 -07:00