Commit Graph

15 Commits

Author SHA1 Message Date
Alessio Quaglino ad80a4625b Always generate a BVH in flex.
The BVH is used also for computing normalized vertex coordinates in the trilinear interpolation, so we need to compute it also when the flex cannot collide.

PiperOrigin-RevId: 756349244
Change-Id: Ib397c472e31251df5a7ea85850d83a62f3b2c949
2025-05-08 09:46:47 -07:00
Mohammad Hamid 3429a4881a Detect mismatch between maxNodes and Nodes in a gmsh block. Fixes #2342
PiperOrigin-RevId: 745967745
Change-Id: If1b5fcd71079a0e6a6def9b442758678e31a5828
2025-04-10 04:15:21 -07:00
Alessio Quaglino 7651cb1b33 Copy texture coordinates from OBJ into flex. Fixes #2464.
PiperOrigin-RevId: 732109960
Change-Id: I506b3540ab5d489ce8f10d0c473919611ccb654a
2025-02-28 06:04:19 -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 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
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
Mohammad Hamid d6bc8c7781 BEGIN_PUBLIC
Replaced "shark" test models with lighter models to speed up tests.
END_PUBLIC.

- procedurally generated light cube
- replaced shark GMSH with cube for all tests with extension GMSH
- Reduced size of shark model used for tests with extension Ftetwild

PiperOrigin-RevId: 631776421
Change-Id: I66f6b4058b86338a10d06c39bc93bef1c6fbdab6
2024-05-08 06:15:18 -07:00
Alessio Quaglino 7eb8c4b9f4 Set all flex edges to rigid when the flex is rigid.
PiperOrigin-RevId: 629740153
Change-Id: Ib2fb6f64e3d160268d2521d63830f41e44d03b20
2024-05-01 09:06:01 -07:00
Mohammad Hamid 131b1745db Added support for GMSH22 surface loading
PiperOrigin-RevId: 629734063
Change-Id: I6a250b81de4e7c8f7520795bfe74a81d719dfb50
2024-05-01 08:44:05 -07:00
Nimrod Gileadi b33230210a Disable precise error message check in LoadMSHASCII_22_MissingNumElements_Fail
For some reason, this check fails on Windows on GH Actions.

PiperOrigin-RevId: 625396036
Change-Id: I96bf233dcd61e7a64f817da41e47ea39e0c5c157
2024-04-16 11:22:54 -07:00
Google DeepMind f086dc9b4b Better parsing for GMSH2.2
PiperOrigin-RevId: 625267106
Change-Id: Iecf767c43cee1067fdab3859df28050f8a365e2b
2024-04-16 03:23:52 -07:00
Nimrod Gileadi 7d3b662d5b Check for invalid node tags in gmsh parser.
PiperOrigin-RevId: 621538409
Change-Id: I91ba56b931d815fccd65ae32281bc19ae3a45ee7
2024-04-03 08:56:57 -07:00
Google DeepMind 4f0293c6cb Added support for msh2.2
Now we can load flex with format 2.2 binary and ASCII.
There are two different parsing strategies. One for gmsh app and the other is for ftetwild.

Used the shark model from Scanned Objects by Google Research:
https://app.gazebosim.org/GoogleResearch/fuel/models/Weisshai_Great_White_Shark

PiperOrigin-RevId: 619229499
Change-Id: I6eb876afcbc8a00631914b093c45bde10c0caaf6
2024-03-26 10:12:13 -07:00
Alessio Quaglino 9e1d7d6ab8 Fix typo in flex and composite error message.
PiperOrigin-RevId: 611115238
Change-Id: Iadb9b4b078e60bca15184f3435380eb67b2da8a9
2024-02-28 08:45:11 -08:00
Alessio Quaglino 5a70ad08ab Add Flex component.
PiperOrigin-RevId: 572830650
Change-Id: I6908228087b7b9683be3506c8d9cdc725ed5dcd5
2023-10-12 10:49:35 +01:00