Yuval Tassa
762371c3e4
Add kv damping attribute to position and intvelocity actuator shortcuts.
...
PiperOrigin-RevId: 588377097
Change-Id: I8ded2ff982e52ed8673019979e29b706ef65c743
2023-12-06 04:28:30 -08:00
Nimrod Gileadi
5e9906be84
s/paramters/parameters/
...
PiperOrigin-RevId: 588113325
Change-Id: I1b7e754c747baedb8d2b154c3dc395a7062e8fc5
2023-12-05 10:20:04 -08:00
Matthew Bennice
c0b7b9873d
Store paths for hfields, textures, and skins similar to meshes.
...
PiperOrigin-RevId: 587283093
Change-Id: Ie6d8d2ecb185697a27d1b6f7fca1312df006af12
2023-12-02 03:51:25 -08:00
Alessio Quaglino
33bd2a986a
Use mesh_pos, mesh_quat instead of geom_pos, geom_mat in ray_sdf.
...
PiperOrigin-RevId: 586632872
Change-Id: I39f99945ccdd6c54f7867adfe06a379d00dc8002
2023-11-30 04:26:07 -08:00
Yuval Tassa
b39cca725a
Move headlight pos/dir computation from mjr_render to mjv_updateScene.
...
PiperOrigin-RevId: 586630110
Change-Id: Ia44ea944016ccfe081682375cdb975342695d826
2023-11-30 04:15:05 -08:00
Alessio Quaglino
e1669b568b
Change default values of flex visualization flags.
...
Deactivated vertices, edges, faces and activated skins. The skin is less precise but faster to render and more importantly when the wireframe is active it allows to look inside the body much more easily.
PiperOrigin-RevId: 585970250
Change-Id: Icb6c0ff6266e552cffce9b0c810f634f9a29a55e
2023-11-28 07:27:54 -08:00
Yuval Tassa
51d80564fa
Don't initialize plugins during model compilation.
...
PiperOrigin-RevId: 585701389
Change-Id: I4e5e34276f404abadf6f5d4d9764ca717304ee34
2023-11-27 11:01:08 -08:00
Yuval Tassa
21334ea704
Delete local frame members from MJC objects.
...
PiperOrigin-RevId: 585629699
Change-Id: I12dbd235dee49223fa7b1a097f04561da69550a0
2023-11-27 06:07:53 -08:00
Alessio Quaglino
eb9568a48b
Add frame element to MJCF.
...
PiperOrigin-RevId: 585598244
Change-Id: I4c06be3dd586dab5a4458f05faaf1e7f2b615458
2023-11-27 03:32:18 -08:00
Alessio Quaglino
d070b1893e
Improved SDF objective function.
...
For two colliding SDFs `A` and `B`, the function is `(A+B)+abs(max(A,B))`. This can also be written as `clearance + abs(intersection)`. This function has the following properties:
- On the penetrating surface, it is equal to `A+B`, i.e. the clearance field which is the penetration depth.
- The object boundary is a set of local minima in 3D space, since `abs(max(A, B))>0` away from the surface.
- Along the penetrating surface, the maximum penetration is a local minimum of the clearance since this field is orthogonal to the midsurface field `A-B`, which acts as a support plane for the contact.
[Level sets of the improved function for two colliding circles](https://www.wolframalpha.com/input?i=plot+sqrt%28x%5E2%2By%5E2%29-1+%2B+sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1+%2B+max%28max%28sqrt%28x%5E2%2By%5E2%29-1%2C+sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%29%2C+0%29+-+min%28max%28sqrt%28x%5E2%2By%5E2%29-1%2C+sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%29%2C+0%29+ ).
PiperOrigin-RevId: 585106580
Change-Id: I5b18a1ef262ceb0a1ab8abcad8acfd6dc1992e2c
2023-11-24 09:07:17 -08:00
Nimrod Gileadi
f2025c6abf
Allow plugin actuators to have activation state.
...
Accept new attributes on the plugin/actuator tag:
- dyntype
- dynprm
- actlimited
- actrange
- actearly
This addresses some of the requests in #1098 .
PiperOrigin-RevId: 584866281
Change-Id: I4f7559e446888216093efba4ced9119cfc0528a4
2023-11-23 05:14:03 -08:00
Yuval Tassa
cd56a41f83
Fix bug in Cartesian actuation with movable refsite.
...
PiperOrigin-RevId: 584035818
Change-Id: I005f6bbbe02f8b36d287ecada0406a6ae4d720ba
2023-11-20 08:37:29 -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
dbf44fe2b4
New SDF objective function.
...
This solves the jittery behavior observed with the gear example in the case of small applied torques (~0.5).
The new quadratic option has the form max(A, 0)^2/2 + max(B, 0)^2/2 - min(A, 0)*min(B, 0). This function has a minimum in the intersections of two SDFs A and B, while avoiding the flat areas which would be generated if only the clearance field A+B were employed. See for example [the function resulting from two colliding circles](https://www.wolframalpha.com/input?i=minimize+max%28sqrt%28x%5E2%2By%5E2%29-1%2C0%29%5E2+%2B+max%28sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%2C0%29%5E2+-+2*min%28sqrt%28x%5E2%2By%5E2%29-1%2C0%29*min%28sqrt%28%28x-1%29%5E2%2B%28y-1%29%5E2%29-1%2C0%29 )
PiperOrigin-RevId: 583992855
Change-Id: I135a1b5931cd136d7d33cc275f8d361a8b7e290c
2023-11-20 05:06:33 -08:00
Matthew Bennice
d3eee0316c
Small changes to Kuka IIWA7 Biarm
...
PiperOrigin-RevId: 583412101
Change-Id: Icee1c5f1f2a9354425d8f6c311322903e1e0af83
2023-11-17 09:37:26 -08:00
Baruch Tabanpour
1554048856
Bump dev version number to 3.0.2.
...
PiperOrigin-RevId: 582773849
Change-Id: I07a70911578fabb556eec1a4d8aa6fcb6557513f
2023-11-15 12:51:04 -08:00
Alessio Quaglino
f5285e0b23
Add flex to dm_control schema.
...
PiperOrigin-RevId: 582323853
Change-Id: I4ce25bf29d0a883bca286954a14c4a07a500f145
2023-11-14 08:05:29 -08:00
Alessio Quaglino
ffca553f64
Do not use the inertia box for volume computation.
...
PiperOrigin-RevId: 582319067
Change-Id: I347d820f48faab15b609bcfc8295b07bd2d0f7ed
2023-11-14 07:46:33 -08:00
Erik Frey
d0cabcf7db
Only apply torquescale once, when setting efc_pos.
...
PiperOrigin-RevId: 580694671
Change-Id: Ic0e2ee773d65d4fd92f4b4102cdfdd040516680a
2023-11-08 16:15:36 -08:00
Yuval Tassa
a6687885a5
In mj_sensorAcc, flip condition for triggering call to mj_rnePostConstraint to enumerate sensors that require the call rather than eliminating those that do not.
...
PiperOrigin-RevId: 579804886
Change-Id: I1093fcfa66e637015cd702d7e59ec3bcddc670ef
2023-11-06 04:51:53 -08:00
Alessio Quaglino
19de607ec8
Undo incorrect change in height field processing.
...
PiperOrigin-RevId: 579502934
Change-Id: Id1fba8fe29a8eb4d4f0358173b34093401e6230e
2023-11-04 12:33:21 -07:00
Alessio Quaglino
549fdddf3d
Fixed a bug with height fields AABB.
...
PiperOrigin-RevId: 579488048
Change-Id: I69a2d05f922b58947b1d468b5b31a4743d375d71
2023-11-04 10:28:00 -07:00
Yuval Tassa
893c404230
Runtime disabling of actuators according to group.
...
Added `option-actuatorgroupdisable` attribute and associated `mjOption.disableactuator` integer bitfield, used to disable sets of actuators at runtime according to their group.
- The first 6 actuator groups are toggleable in the `simulate` viewer.
- Minor refactor and cleanup of actuator documentation.
https://youtu.be/H9qG9Zf2W44
Fixes #1092 .
PiperOrigin-RevId: 578335600
Change-Id: I4cf663b90ea768e4380acfa2fe3b8c15c7cbb568
2023-10-31 16:24:38 -07:00
Nimrod Gileadi
64a59bb2dc
Use the correct free function to free plugin data.
...
The array was created with `mju_malloc` (which does an aligned alloc) and released with `free` (which doesn't care about alignment), which led to errors on Windows.
PiperOrigin-RevId: 578186714
Change-Id: I193987bed061e945c49d7268a9a9af3f17af362a
2023-10-31 08:07:22 -07:00
Alessio Quaglino
50843cad30
Add defaults to SDF plugin attributes.
...
Expose diameter and number of teeth for the gear SDF.
PiperOrigin-RevId: 577779297
Change-Id: Iec5890ab7f39080b395cf06a76f9c2216f4f39ed
2023-10-30 03:09:25 -07:00
Yuval Tassa
c921c3956e
Change keyboard shortcut key to visualize equality constraints from N to E. Delete the keyboard shortcut of the Selection Point.
...
PiperOrigin-RevId: 577770608
Change-Id: I5428a58dff93c95bcb71c27d0e65d2303a23b129
2023-10-30 02:42:26 -07:00
Yuval Tassa
86d9c84e59
Fix bug in implementation of torquescale
...
PiperOrigin-RevId: 577466789
Change-Id: I3c8e5dd9b4af9a629e777f7ccad8417075b0046c
2023-10-28 08:25:25 -07:00
Nimrod Gileadi
f8c5ad2ba8
Check for errors when calling std::stod in XML loading.
...
PiperOrigin-RevId: 576608985
Change-Id: I148ca67d8960d73c281df2d6f2440d47940a6369
2023-10-25 12:26:43 -07:00
Alessio Quaglino
1a47a97040
Disable shadows for geoms of category mjCAT_DECOR. Fixes #1114 .
...
Added `frustum` to `rgba` and `scale` in the `visual` section.
PiperOrigin-RevId: 576547599
Change-Id: I69bf528680e3d4a59d6e04f6db99a6d345001d1d
2023-10-25 09:08:20 -07:00
Yuval Tassa
a89412bb4a
Add components of qfrc_passive to mjData: qfrc_{spring, damper, gravcomp, fluid}.
...
PiperOrigin-RevId: 576493532
Change-Id: If8eda1a2bb728fe8ab91b8004f97fc729d999ad9
2023-10-25 05:01:45 -07:00
Nimrod Gileadi
97d99c84ce
Delete the temporary mjData if model reference validation fails.
...
PiperOrigin-RevId: 575852845
Change-Id: I2146dbc510b48c310ac338adcd5d53cb9f38b383
2023-10-23 10:07:55 -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
c6ef4f71c3
Add flex fields to mj_validateReferences.
...
PiperOrigin-RevId: 575779915
Change-Id: I14d22092e7d712dcc3d474cf0c2a85ef4d6a4aee
2023-10-23 04:44:32 -07:00
Alessio Quaglino
01a932e052
Fix flex constraint Jacobian for edges belonging to a single body.
...
PiperOrigin-RevId: 575161094
Change-Id: If4153bcb751cdd6dbdddeb08672f7107c7c5bbc2
2023-10-20 02:49:34 -07:00
Saran Tunyasuvunakool
269d88ad92
Bump dev version number to 3.0.1.
...
PiperOrigin-RevId: 574451745
Change-Id: Iedbbb3304b88876f31a6196d690a1f05c6428e2f
2023-10-18 15:01:21 +01:00
Alessio Quaglino
d0294b7cc0
Initialize contact frame in planeVertex contact.
...
PiperOrigin-RevId: 574416404
Change-Id: I305f7113364ad9198947c5aa7346bb832fc43146
2023-10-18 02:56:14 -07:00
Erik Frey
8f9c690c85
Add MJX and bump version number to 3.0.0.
...
Co-authored-by: Baruch Tabanpour <btaba@google.com >
PiperOrigin-RevId: 574327508
Change-Id: Ia9b62fbc929c6869dfcec87636b2e10d405a1060
2023-10-18 10:33:29 +01:00
Alessio Quaglino
3f3d5a3b49
Fix contactcompare swapping condition.
...
PiperOrigin-RevId: 574276137
Change-Id: Iafbb6a99c1fb57907d3cb1d0796b6ad718e549d2
2023-10-17 15:05:20 -07:00
Yuval Tassa
d0bdb78207
Disable island discovery for models with flexes.
...
PiperOrigin-RevId: 574244981
Change-Id: I7c08b23cf5f29338a04ec684ad7a0d4d8a0397df
2023-10-17 13:17:24 -07:00
Alessio Quaglino
317d6d9ebe
Move edge creation after element reordering in mjCFlex.
...
PiperOrigin-RevId: 574193046
Change-Id: If2fb01b3494d637d4b220d03e7d7d84e4a9f7a2d
2023-10-17 10:28:43 -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
Yuval Tassa
a9ee497e33
Add spaces around comparison operators.
...
PiperOrigin-RevId: 573620198
Change-Id: Icf295cc0dd381a4a7f0e2c94f2e12b499193e862
2023-10-15 07:40:10 -07:00
Yuval Tassa
a1b6026b8c
Delete derivative code sample.
...
PiperOrigin-RevId: 573477509
Change-Id: I0e619e36dd3fe677a27bbbdac87a15f04670cc13
2023-10-14 08:38:37 -07:00
Nimrod Gileadi
eb41c720d4
Restore full state in mjd_stepFD.
...
Make sure that plugin state is also restored after finite-difference calculations.
PiperOrigin-RevId: 573272654
Change-Id: Ie276ecc391c463ae5c47cafa5b8de873b9345a7d
2023-10-13 11:23:52 -07:00
Yuval Tassa
d88675a034
Change the default of <compiler autolimits> from "false" to "true".
...
PiperOrigin-RevId: 573184793
Change-Id: I24075a8d953d0a3c3ddf65c67e1e18075cd029b6
2023-10-13 05:05:24 -07:00
Alessio Quaglino
389e13938e
Fix typos in docs.
...
PiperOrigin-RevId: 573172715
Change-Id: I0073d0872597b01d84151b9eea578cc0ae0a5013
2023-10-13 04:05:30 -07:00
Copybara-Service
59164702ab
Merge pull request #978 from aftersomemath:depth-precision-in-place
...
PiperOrigin-RevId: 572961667
Change-Id: I69011ddf835ae286e30e7f84cca67867cfe94fa4
2023-10-12 11:18:36 -07:00
Saran Tunyasuvunakool
86859ad382
Restore shadows when flex is present.
...
PiperOrigin-RevId: 572936749
Change-Id: I57f8d486810767422bc2874433497eb5073bf63b
2023-10-12 09:58:59 -07:00
Nimrod Gileadi
60fd6a3298
Check if there's enough data in the buffer before reading fields while loading MJB.
...
Before this change, loading a truncated MJB file would crash with mjERROR. After this change it will just return NULL.
PiperOrigin-RevId: 572928724
Change-Id: I9611eaffcc2e5ef1b957f48162ce2ef29619e087
2023-10-12 09:30:00 -07:00