Kyle Bayes
266161ee4c
Convert mju_openResource to write warnings to a given error string.
...
PiperOrigin-RevId: 606907392
Change-Id: Ic70e980aa9ba2bdbe1787773f51749b34f74afed
2024-02-14 02:17:40 -08:00
Saran Tunyasuvunakool
dc40bbd1f5
Refactor global object tables logic.
...
This unifies the implementation for plugins and resource providers.
PiperOrigin-RevId: 605617372
Change-Id: I2ea52b4c53f48c4c59edd5fdc1c51c7edba7340e
2024-02-09 06:50:06 -08:00
Meghha Dhoke
f763254a00
Updating Mujoco Release version number to v3.1.3
...
PiperOrigin-RevId: 604459311
Change-Id: I766f704c28740cf751cb935bb48fb6954fccf024
2024-02-05 15:59:20 -08:00
Alessio Quaglino
c8e839a666
Do not create contact if there are no DOFs.
...
PiperOrigin-RevId: 601146599
Change-Id: I68b1975a3217b266bbbfb0a15c85a65cfa46facb
2024-01-24 09:37:40 -08:00
Yuval Tassa
fea7c10b95
Add bvhactive flag to visual/global. Fixes #1279 .
...
PiperOrigin-RevId: 599778272
Change-Id: If5530629035cc68b198447503388f59a04041b13
2024-01-19 02:59:56 -08:00
Yuval Tassa
2feefbc5d2
Remove fine-grained timing from narrow-phase collision functions, delete mjTIMER_COL_MID.
...
PiperOrigin-RevId: 599225419
Change-Id: Ieca166753c20a0abf660e2821b2844dda8758951
2024-01-17 10:54:23 -08:00
Yuval Tassa
a14a584f1d
Fix bug in muscle length-gain curve. Fixes #1342
...
PiperOrigin-RevId: 599165049
Change-Id: Ic5ef77b4349a8a9c343eacfd781195bfebea9aca
2024-01-17 07:20:01 -08:00
Yuval Tassa
67a00a3a51
Rename mjMAXTHREADS -> mjMAXTHREAD (consistency).
...
PiperOrigin-RevId: 599130235
Change-Id: Ia80379b8ae0574a7cd8fbc668657f806e90d6c5c
2024-01-17 04:33:44 -08:00
Yuval Tassa
79bcfecba4
Tidy up mj_kinematics implementation.
...
PiperOrigin-RevId: 597556619
Change-Id: Iaf108a6582e8135c7169dad07ed0654bdea8ee71
2024-01-11 08:00:06 -08:00
Yuval Tassa
60cd7248c2
Add zero vector shortcut to mju_rotVecQuat.
...
PiperOrigin-RevId: 597504456
Change-Id: I23580fc08571db97e984a87cba3f4d14e67d6b3a
2024-01-11 03:19:30 -08:00
Yuval Tassa
4c066a26b5
Change mjVISSTRING of connect and weld equality constraints from "Constraint" to "Equality". This is more consistent with the 'E' shortcut key and with mjDISABLESTRING ("constraint" means all constraints, "equality" means bilateral constraints).
...
Also remove unused ampersands from `mjVISSTRING` names, these are a remnant from a very old version of the UI framework.
PiperOrigin-RevId: 593469811
Change-Id: I0f6f73c9f5d2c61b2280f395f76434b0710ce4f3
2023-12-24 12:06:59 -08:00
Google DeepMind
7fb448613f
Post release version update: Update to V3.1.2
...
PiperOrigin-RevId: 592019826
Change-Id: I64fd7da628bf3312ede4970b9b10ef5d0cc75b45
2023-12-18 15:03:37 -08:00
Nimrod Gileadi
7cb7c87f70
Fix a few issues with the passive viewer.
...
1. Create an arena for the mjData instance used by the passive viewer visualization.
When using the passive viewer, stuff gets copied from the real mjData into a minimal struct.
That struct didn't have a stack, and now visualization for Flex does stack allocs.
2. Add missing a missing field in scene state for flex visualization.
3. Fix a memory leak where mjvScene wasn't released on exit in the passive viewer.
4. Add some locks in places where the render thread and Simulate::Sync collide.
This fixes #1280 .
PiperOrigin-RevId: 591891676
Change-Id: I592f286cab9719c8d9af84e42f9756ea1f9f1971
2023-12-18 07:33:19 -08:00
Yuval Tassa
38fa756a20
Add mjGEOM_LINEBOX, used in visualization of collision trees.
...
PiperOrigin-RevId: 591224734
Change-Id: I09ad8c4b711021ff4dd5548ba5381d25d5a3d7f8
2023-12-15 05:36:35 -08:00
Yuval Tassa
f2a967348c
Fix bug introduced in 7942fe957e
...
That change removed some spurious contacts returned by mjc_BoxBox, but also removed some desirable contacts that occur during very deep penetration of two boxes (when one box is completely inside another box). This is now fixed.
PiperOrigin-RevId: 591036252
Change-Id: I84b51f2179fd6fe29618a4e908e86934c6fc6941
2023-12-14 13:30:38 -08:00
Google DeepMind
c2c76195dd
Updating Mujoco Release version number to v3.1.1
...
PiperOrigin-RevId: 590712172
Change-Id: Ibf32322222212c1bf098e75bbb2e145344c57b93
2023-12-13 14:26:08 -08:00
Yuval Tassa
1c34553631
Add shortcuts for power function in impedance computation.
...
PiperOrigin-RevId: 590692245
Change-Id: I1a49475c9a8299f4845e4ec33c9a7ce21a9c5d2b
2023-12-13 13:14:27 -08:00
Google DeepMind
fcebdf4d09
Update MuJoCo to v3.1.0 for release.
...
PiperOrigin-RevId: 590256664
Change-Id: I42ad788d609dde0ff00b13a2e456b2a8d3d9e952
2023-12-12 10:37:47 -08:00
Yuval Tassa
28a9e6d9a2
Add mjNOBJECT value to mjtObj enum.
...
PiperOrigin-RevId: 590164716
Change-Id: I500741aa4fb97fe2c4f5d2086188bb2c9fdfd1a0
2023-12-12 05:15:00 -08:00
Copybara-Service
5c8f22609a
Merge pull request #1263 from limymy:main
...
PiperOrigin-RevId: 589857317
Change-Id: I5f241f5c798811b0d082ba4bed9ca8c8233e4052
2023-12-11 09:59:59 -08:00
Yuval Tassa
7942fe957e
Circumvent bug in mjc_BoxBox.
...
The box-box collider sometimes outputs bad contact points which are far outside one of the two boxes. This happens at configurations which are very rare numerically, but rare configurations (e.g. perfect box alignment) are often induced by the designer and the physics, making them actually not-so-rare.
Since the box collision functions are very difficult to understand, we circumvent the issue by extending the post processing code to detect and remove such contacts.
PiperOrigin-RevId: 589178197
Change-Id: I82b8a888ef04f9196111c960757e3314d0ab6d8e
2023-12-08 10:39:27 -08:00
limymy
08c6233912
fix gcc warning "stringop-truncation"
2023-12-07 14:36:29 +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
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
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
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
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
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
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
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