Commit Graph

81 Commits

Author SHA1 Message Date
Alessio Quaglino 7edbdd0ad6 Remove the Shell plugin and integrate it into the engine.
PiperOrigin-RevId: 760688502
Change-Id: Ia70988d42b7edf571d7cb4a4f48f8fc50b51667d
2025-05-19 10:51:25 -07:00
Alessio Quaglino 71bdd915f7 Move bending stiffness from plugin to the compiler.
PiperOrigin-RevId: 758677644
Change-Id: I7d5c5140ba6948002bfa4ae9d6b4bf0f6de0e39b
2025-05-14 07:39:24 -07:00
Alessio Quaglino 2386dfd7da Add touch sensor for estimating the surface contact stresses from the SDF.
PiperOrigin-RevId: 758556339
Change-Id: Ib56d76fab084b530fd68d61a29294cb6f1d05f3f
2025-05-14 00:45:58 -07:00
Alessio Quaglino d77126dc58 Add vertcollide option for adding spheres at flex vertices.
PiperOrigin-RevId: 757789990
Change-Id: I8ccba52b13e8c02a7be78f992297d6f414d98f8e
2025-05-12 09:13:48 -07:00
Alessio Quaglino bae5175cf2 Accumulate rotation after updating pos and quat in replicate.
Fixes #2501.

PiperOrigin-RevId: 737929158
Change-Id: I0cad2de37190f1d30d427ae646acbde335b5be56
2025-03-18 02:51:05 -07:00
Copybara-Service b9a23e8d0c Merge pull request #2475 from lyd405121:main
PiperOrigin-RevId: 735789711
Change-Id: Iad5a52a0ba29baad31ba60f0243e3b88553e6e96
2025-03-11 09:48:23 -07:00
蕉太狼 56dda2b4de [Add Model] Make a flex with textured bunny
- Make a flex with textured bunny from disscution(https://github.com/google-deepmind/mujoco/discussions/2442)
2025-03-03 16:45:43 +08:00
蕉太狼 e16354a527 [New Model] Add a bunny with uv coordinate
- Using [UVAtlas](https://github.com/Microsoft/UVAtlas) to unwrap and generate from the [origin bunny](https://github.com/google-deepmind/mujoco/blob/main/model/flex/asset/bunny.obj)
2025-03-03 16:44:03 +08:00
Alessio Quaglino c52d1b3941 Remove the particle composite (replaced by replicate).
PiperOrigin-RevId: 730089997
Change-Id: If8d18fb56ae01241e76f84dbf7951e034026d829
2025-02-23 03:14:11 -08:00
Alessio Quaglino 0fcd20f0da Remove grid from composite types.
Replaced it with flexcomp in the models.

PiperOrigin-RevId: 730070619
Change-Id: Icbc69e4c6784c6252743f689a1eafb6482d0c393
2025-02-23 01:31:41 -08:00
Alessio Quaglino 7cdf180641 Introduce trilinear flex parametrization.
These flexes use only 24 DOFs (3 per vertex of the bounding box), while colliding with the full high resolution mesh.

On an 8x8x8 cube, the performance using DOFs at all vertices is

```
 Simulation time      : 18.74 s
 Steps per second     : 533
 Realtime factor      : 0.53 x
 Time per step        : 1874.4 µs

 Contacts per step    : 114.88
 Constraints per step : 3322.51
 Degrees of freedom   : 1536
```

With the new implementation, it is the following:

```
 Simulation time      : 1.82 s
 Steps per second     : 5507
 Realtime factor      : 5.51 x
 Time per step        : 181.6 µs

 Contacts per step    : 38.84
 Constraints per step : 155.36
 Degrees of freedom   : 24
```

PiperOrigin-RevId: 721008829
Change-Id: I833df027527db578d86667cc4b24295bcf6f7d22
2025-01-29 09:38:22 -08:00
Alessio Quaglino ee6f4837f3 Auto-generate 3D mesh from convex OBJ if dim=3 in flex.
This requires the user to explicitly specify an origin.

PiperOrigin-RevId: 712483526
Change-Id: Ie316a5eccb676bb918d4bb746795019145c10f5b
2025-01-06 04:35:59 -08:00
Alessio Quaglino 300450f8b8 Add circle to flexcomp and remove rope and loop from composite.
Add pulley example to show a circle use case.

Switch on flex edge rendering by default (no effect when flex skin is rendered).

PiperOrigin-RevId: 700738379
Change-Id: I8469bbf194de01c8dab66c9a51c49879013df141
2024-11-27 10:14:25 -08:00
Alessio Quaglino 831d9881d3 Remove box, cylinder and ellipsoid composite types.
Also, fix a bug with Flex textures that was causing an incorrect allocation of the textures in mjModel. Fixes #2013.

PiperOrigin-RevId: 692510858
Change-Id: If781716216974e085244da27bc3aa57d91c3458c
2024-11-02 11:14:13 -07:00
Yuval Tassa d646ba8de1 Update MuJoCo changelog with a video of the 100_humanoids model.
Improve the model's rendering FPS by reducing the number of shadow-casting lights from 7 to 2.

https://youtu.be/e8lUuykQPGs

PiperOrigin-RevId: 686118052
Change-Id: If376564fdc23ad8d754dac1e5825079c0b806063
2024-10-15 08:40:06 -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
Yuval Tassa 395129bbd3 Improvements to lighting and replication logic in humanoid.xml and 22_humanoids.xml.
Minor fix to memory usage printing in simulate.

PiperOrigin-RevId: 683787943
Change-Id: I0a42dacc8af0e659c3817df57bceb76d9e4d5ae3
2024-10-08 15:36:22 -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 b15de2c951 Add elasticity parameters to the schema.
PiperOrigin-RevId: 675115200
Change-Id: Ic6608ce61cbb857dca71b3d9cbdac057e8f1ac7a
2024-09-16 05:56:36 -07:00
Yuval Tassa 4e3dc14f8e Remove model/humanoid100/humanoid100.xml (used <include>), replace with model/humanoid/humanoid100.xml (uses <attach>)
PiperOrigin-RevId: 673123895
Change-Id: I0c3c6dac69d9fc12a6ea76d586c34503fc167bad
2024-09-10 15:14:04 -07:00
Alessio Quaglino 4862b9e765 Remove plugin support from Composite particles.
This functionality is replaced by FlexComp.

PiperOrigin-RevId: 672503965
Change-Id: I58953267de285f82e416f9f60576a336b7d0da4c
2024-09-09 04:58:26 -07:00
Google DeepMind 70d70bc3b7 Fix typos in MuJoCo documentation.
PiperOrigin-RevId: 656068822
Change-Id: I5ebbb3701148ea4d978a6a1ad3f762ffcc7e57cb
2024-07-25 13:31:13 -07:00
Alessio Quaglino 27b9ddda5b Add attach tag to MJCF.
PiperOrigin-RevId: 651117953
Change-Id: I57b0e53ed44607d479b3785d908e0837c0804cf3
2024-07-10 12:41:43 -07:00
Nimrod Gileadi 393895bb29 Explicitly specify actdim on PID plugin actuators, to allow them to be used with keyframes.
Support actdim attribute on plugin actuators.

Remove the actuator_actdim callback. This callback leads to crashes when loading keyframes for models that have a stateful plugin.

PiperOrigin-RevId: 650649505
Change-Id: I40d1994d02ae4e20ce631b2702a984766cf2628e
2024-07-09 09:08:48 -07:00
Yuval Tassa 19d505d847 Remove unused texture attribute in some models.
PiperOrigin-RevId: 648497401
Change-Id: I9f9a843abfb710afaf25798fa659efd92bcd7007
2024-07-01 15:05:02 -07:00
Alessio Quaglino 26f23066d1 Add replicate element to MJCF. Fixes #553
PiperOrigin-RevId: 629393578
Change-Id: Ia1db1b9e47eba8868117b0f7b85edcd0cc1b6d79
2024-04-30 06:29:18 -07:00
Alessio Quaglino 8f1ea05bef Add disc mesh generation to user_flexcomp.
PiperOrigin-RevId: 611462985
Change-Id: I0fc195d8733172f5f4347b04b5de0edfdd12613d
2024-02-29 07:24:47 -08:00
Yuval Tassa 7c534a066c Sort humanoid actuators in the same order as the joints.
PiperOrigin-RevId: 608558353
Change-Id: I84015a92c39c187f65d59623f2793c29bf24b8ef
2024-02-20 04:41:17 -08:00
Kevin Zakka 8d1b05bbd2 Fix markdown hyperlink.
PiperOrigin-RevId: 595383191
Change-Id: Ia11b962c68ed33cc0fd6c5279f571f4b21d81570
2024-01-03 06:19:32 -08:00
Kevin Zakka cd972bbeee Document humanoid model changes in changelog section of its README + minor cosmetic improvements.
PiperOrigin-RevId: 595367344
Change-Id: I17483de71c6cbcf6a66e2fad762cc32f8cbee8b5
2024-01-03 04:47:05 -08:00
Yuval Tassa e07ea625ac Add keyframes to humanoid model.
PiperOrigin-RevId: 595175659
Change-Id: I2aae405a5dfbd9b14253d6330cb12003bd4f6c08
2024-01-02 12:00:46 -08:00
Alessio Quaglino 7d8d4d398e Make elasticity plugins compatible with flex pins. Fixes #1235.
Before change:
poncho       18.20s
poncho_flex  44.60s
floppy       4.70s
floppy_flex  6.43s

After change:
poncho       18.23s
poncho_flex  44.62s
floppy       4.67s
floppy_flex  6.57s

PiperOrigin-RevId: 585952587
Change-Id: I0e7c1513f64c7ab1e6ad71e2168b4467c042b46f
2023-11-28 06:13:43 -08:00
Yuval Tassa 37bb03f435 Move humanoid geoms to group 1
PiperOrigin-RevId: 585632746
Change-Id: I832804b9c0d090506c3b4ed5c0eeeb5e4cae412a
2023-11-27 06:23:54 -08:00
Nimrod Gileadi 002b427a32 PID Controller as an actuator plugin.
Implement a configurable PID controller.

PiperOrigin-RevId: 585282014
Change-Id: I2d884554629101a0a25b5e0979ffb1ff8ed9cab4
2023-11-25 08:41:01 -08:00
Alessio Quaglino 8ca51b5318 Backtracking line search for SDF collisions.
Increased tolerance above zero in nutbolt.xml since now the two parts lock otherwise. Measured speedup of 2x in this example.

This solves the issue of scale-dependent step sizes. Tested on gears with 10cm diameter and 2cm thickness.

PiperOrigin-RevId: 584009449
Change-Id: Ied2f62dbbbc592470b91cf910f3553802a57c752
2023-11-20 06:33:01 -08:00
Alessio Quaglino 40d927c9fa Move 2d and 3d plugin force computation to elasticity.h.
Change physical properties of `floppy_flex.xml` to resemble `floppy.xml`.

Make `Membrane` backward compatible with `Composite`.

PiperOrigin-RevId: 577190384
Change-Id: I5bc56ec62faa134156e839bec45d685c22eba5c4
2023-10-27 07:18:08 -07:00
Alessio Quaglino 643c1248b8 Skip flex edge Jacobian if not needed.
When equality constraints and built-in passive forces are not present, edge Jacobians are unused. This gives a 3x speedup in `mj_kinematics` in `floppy_flex` (from 0.2ms/step to 0.06ms/step).

Changed the default options of `floppy_flex` to match those of `floppy` for a fair comparison.

PiperOrigin-RevId: 575850622
Change-Id: I4c618536fd17ef930153bbd1f1da7d9e0e44abbe
2023-10-23 10:02:00 -07:00
Alessio Quaglino 139a8ae298 Add flex and elasticity documentation. Fixes #873.
PiperOrigin-RevId: 574179040
Change-Id: Iaf90bbf2b2c3fe075c940c2b66b7b841f256e653
2023-10-17 09:46:07 -07:00
Alessio Quaglino d67b8c6251 Add membrane plugin (2D Flex elastic stiffness).
PiperOrigin-RevId: 574109411
Change-Id: I4a701d8189cecf540cd200bd30cb4582f3c7dd43
2023-10-17 04:55:33 -07:00
Alessio Quaglino 110ade1435 Update Solid and Shell plugins to use FlexComp.
PiperOrigin-RevId: 573755821
Change-Id: I3b8d7fb27f0e940038fa9fd2b26ecc746df4f7ac
2023-10-16 03:03:06 -07:00
Alessio Quaglino f0608648cb Stricter swapping condition in mju_eig3.
This solves the texture rendering issue with the Rubik's cube. The texture were specified with respect to the incorrect frame, so a default rotation of (0, 0, pi/2) is now applied to the model file.

PiperOrigin-RevId: 571715153
Change-Id: I3efae3b1fc8f64e6c9e4db90a7609506e3cbed86
2023-10-08 04:04:34 -07:00
Yuval Tassa 7b7cf5e86c Add cards.xml model.
PiperOrigin-RevId: 571341445
Change-Id: I3a02bb01099cacb62e0c599e6198ed90b48baad0
2023-10-06 08:13:33 -07:00
Alessio Quaglino d3d46e16a4 Remove cloth and rope composites and deprecate loop.
PiperOrigin-RevId: 568168329
Change-Id: Ida4a5236bef74828c7bf59affdc28adea3db53b1
2023-09-25 03:38:43 -07:00
Alessio Quaglino dd5a7115cf Add shell plugin.
- Add bending passive force
- Add two examples (plate and poncho)
- Add stretching constraints for particles using tendons on mesh edges

PiperOrigin-RevId: 566980584
Change-Id: Id0cd8e1084c05560f1008518a8afbd5311d563e2
2023-09-20 09:00:20 -07:00
Alessio Quaglino 1afd98ec4b Add [SdfLib](https://github.com/UPC-ViRVIG/SdfLib) plugin to first-party SDFs.
The following dependencies are disabled with a cmake patch file.
- Enoki
- OpenMP
- Assimp
- FCPW

PiperOrigin-RevId: 565352386
Change-Id: Icff9de68408e0afa2032bb83b24491fc4e41d181
2023-09-14 06:42:42 -07:00
Alessio Quaglino 8421544add Added elasticity and sensor subfolders in model/plugin.
PiperOrigin-RevId: 558751363
Change-Id: I15acefc88e5fead1069b58ffb722ea4dc5d53c9b
2023-08-21 04:48:45 -07:00
Alessio Quaglino fdb041580c Add Signed Distance Field to collision geometries.
PiperOrigin-RevId: 557507088
Change-Id: I358a642407aee1ba8dfc9d405eb9a4f609435fe9
2023-08-16 09:15:23 -07:00
Yuval Tassa a276c49c30 Rename `actuatorforcerange and actuatorforcelimited, to actuatorfrcrange and actuatorfrclimited`, respectively.
PiperOrigin-RevId: 556780590
Change-Id: Ide12cf390920f9efe6f79cc9f864a480ce5f256d
2023-08-14 07:18:57 -07:00
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
Yuval Tassa eca0df4c6c Improve formatting of cubelet vertices.
PiperOrigin-RevId: 533031494
Change-Id: I27b6e9eb17c3ebb1382d0e3d5ccb2402f00fbddc
2023-05-17 23:32:07 -07:00