Commit Graph

57 Commits

Author SHA1 Message Date
Copybara-Service 170a060a50 Merge pull request #601 from Balint-H:fix/mesh-filter-disappear
PiperOrigin-RevId: 490719489
Change-Id: I04bdd2f302197a06acaf922e9d10a0bbf00ee89a
2022-11-24 05:46:49 -08:00
Bálint Hodossy dc927b367d Remove unnecessary unit conversion 2022-11-23 16:26:42 +00:00
Bálint Hodossy 12d3e0ae09 Create separate mesh when MjMeshfilter is first instantiated, to support duplicating in Editor 2022-11-23 15:02:35 +00:00
Copybara-Service 6f2092bef2 Merge pull request #593 from Balint-H:feature/unity-ccd
PiperOrigin-RevId: 489551476
Change-Id: I751d2faa95d82f201614e8a3f08a9629492bfbe7
2022-11-18 13:38:51 -08:00
Bálint Hodossy 5c79a9a8fe Add multiccd option in Unity MJCF parser and writer 2022-11-18 13:10:06 +00:00
Bálint Hodossy 1fdbfa7061 Add MjScene property to check if scene has initialized 2022-11-18 11:25:08 +00:00
Bálint Hodossy 2328316d7d Add synchronisation events to MjScene 2022-11-18 11:23:41 +00:00
Saran Tunyasuvunakool 9ecade0707 Move plugin loading and scanning logic from Simulate to MuJoCo library.
PiperOrigin-RevId: 489020177
Change-Id: I1c29d931b47d5252e57e1d797cc7c17645859ffc
2022-11-16 13:15:51 -08:00
Copybara-Service f2bae1ffe3 Merge pull request #556 from Balint-H:fix/uv
PiperOrigin-RevId: 487203617
Change-Id: I6eade6f871b80f78f2ed13e1b5e4672ef857b9ef
2022-11-09 04:14:27 -08:00
Alessio Quaglino fd4d47e4a5 Format memory warning in human-friendly way.
PiperOrigin-RevId: 486610408
Change-Id: I6beecb12059e69f4407e921d20efc54ce6b3f491
2022-11-07 02:56:07 -08:00
Yuval Tassa 36b30e4500 Allow more than 1 activation state per actuator, but only for dyntype user.
Fixes #305.

PiperOrigin-RevId: 486597273
Change-Id: I3eb806f60949e68ebe6cbe35a6e66218a167ed45
2022-11-07 01:43:02 -08:00
Yuval Tassa c83be2bc05 Add mju_clip, mju_fill, mju_eye and mju_symmetrize to python bindings.
- Also change signatures of `mju_fill` and `mju_symmetrize` to conform to standard.

PiperOrigin-RevId: 485613824
Change-Id: I8dd618bac92ef40aa6c76380fa73302e81968687
2022-11-02 09:22:28 -07:00
Bálint Hodossy f6fd7efeb3 Add UVs to newly created geom meshes 2022-11-01 22:21:30 +00:00
Kyle Bayes 23092a11d7 Add per-body gravity compensation (buoyancy) passive force.
PiperOrigin-RevId: 485342531
Change-Id: Icb3e6bb5080b6ef17a3d3b1cc67e0503cfeaeffb
2022-11-01 09:48:06 -07:00
Saran Tunyasuvunakool c7960385be Declare DllMain as extern "C".
Fixes #550.

PiperOrigin-RevId: 484540205
Change-Id: I3915f65f1ae6ab3a93118b9d747b5c09d9abe872
2022-10-28 08:41:46 -07:00
Yuval Tassa 0eb7f871b9 Remove requirement that stateless actuators come before stateful actuators.
PiperOrigin-RevId: 484332415
Change-Id: I1dae92c0f8e027e4ca71c20ea3f68b2926526f53
2022-10-27 13:18:57 -07:00
Yuval Tassa f905c7fb7f Add mju_fill, mju_symmetrize and mju_eye utility functions.
PiperOrigin-RevId: 484226916
Change-Id: I79593d54e903ddacab0f859bfc6d17eccad7d3a1
2022-10-27 05:28:26 -07:00
Saran Tunyasuvunakool 57b0b36699 Bump version number to 2.3.0.
PiperOrigin-RevId: 481823754
Change-Id: Ie8c2c65b11178952355830ef019fe2efdf774189
2022-10-17 22:36:59 -07:00
Alessio Quaglino e250ff0d5a - Added passive forces plugins
- Added new `cable` composite type:
  * The `initial` parameter specifies the joint at the starting boundary: `free`, `ball`, or `none`.
  * The boundary bodies are exposed with the names:`B_left` and `B_right`.
  * The vertex initial positions can be specified directly in the XML with the parameter `vertex`.
  * The orientation of the body frame **is** the orientation of the material frame of the curve.

- Added new `cable` passive force plugin:
  * Twist and bending stiffness can be set separately with the parameters `twist` and `bend`.
  * The stress-free configuration can be set to be the initial one or flat with the flag `flat`.
  * New cable example showing the formation of plectoneme.
  * New coil example.
  * New belt example showing interaction between twist and anisotropy.
  * Added test using cantilever exact solution.

PiperOrigin-RevId: 480033694
Change-Id: I491271bce8fccb185961477e903e5a72d172c8a3
2022-10-10 02:46:51 -07:00
Saran Tunyasuvunakool 1a393429ef Fix formatting of large unsigned numbers in mju_warningText.
PiperOrigin-RevId: 479902611
Change-Id: Ia7187478a246b8b068684e75d6f3851d749844c9
2022-10-09 04:55:26 -07:00
Copybara-Service 2a8acf77ed Merge pull request #491 from Balint-H:weld
PiperOrigin-RevId: 479802394
Change-Id: Ieefec4e1ca29fb137947d458837d8ff3c3ee97f3
2022-10-08 09:24:29 -07:00
Bálint Hodossy 0ae8b966e7 Remove stray space in MjEngineTool 2022-10-08 14:04:37 +01:00
Saran Tunyasuvunakool 58fd72f53d Dynamically allocate contact and efc_ arrays on a new memory arena.
- Add private function `mj_arenaAlloc`. This is used internally to allocate memory from the arena.

- Add private function `mj_nefc` to count constraints. This function returns a tight upper bound on `d->nefc`. The number of counted constraints can be slightly bigger than exact `d->nefc` in the case of constraints with empty Jacobian, as when placing a frictional tendon between two world sites.

- Add new `memory` attribute to the `size` XML element for specification of arena memory size. This attribute is mutually exclusive with `nstack` and `njmax` specifications, which are now deprecated (but left around for the time being for legacy compatibility).

- Move `d->stack` to the end of the new arena space. The stack now grows in reverse from the end.

PiperOrigin-RevId: 479341539
Change-Id: Ie019c202e0908577ffc6f833a37920858116f667
2022-10-06 10:03:05 -07:00
stonfute 401e5daf82 Update float parsing
Update float parsing using InvariantCulture to not depend on OS language to parse float value.
Usefull for French, German, ... users where comma is default notations for the decimal point parsing.
2022-10-06 12:14:18 +02:00
Alessio Quaglino bc1490b7a8 Add realtime parameter to visual global.
PiperOrigin-RevId: 478775714
Change-Id: Ic2d178a5c57d298d005215219ce8470392c4651b
2022-10-04 07:09:15 -07:00
Bálint Hodossy d0a628f464 Fix MjWeld using wrong address in Unity plugin 2022-09-17 17:35:09 +01:00
Saran Tunyasuvunakool 1e2a9a53bc Implement plugin mechanism for actuators and sensors.
PiperOrigin-RevId: 474874088
Change-Id: I65a8ffdf845f4fa0f8266c165883a747ab5812d8
2022-09-16 12:21:29 -07:00
Tom Erez 68718e76b1 Ensure that memory allocated by mju_malloc is freed by mju_free.
Previously, `vfs->filedata` memory was allocated via `mju_malloc` in C and released using `Marshal.FreeHGlobal` in C#. In 5cc73c30bf, `mju_malloc` started returning 64-byte aligned pointers, which should not be freed by a deallocator that isn't aware of this alignment.

Fixes #479.

PiperOrigin-RevId: 474596441
Change-Id: I8a8383c7eaa2c1ec516d81f92a2f90e7aedfe2ee
2022-09-15 10:26:09 -07:00
Tom Erez b1eb1fccef Update bindings to latest version of headers.
PiperOrigin-RevId: 474353426
Change-Id: I749b459c7dc284bf80dd05cb0e6c7ef682a100a8
2022-09-14 11:58:31 -07:00
Tom Erez ee9eccc992 Update Unity bindings to latest headers.
PiperOrigin-RevId: 474291658
Change-Id: I3d92a83face0e6f05defbb7dd5d883cf8180ae98
2022-09-14 08:00:45 -07:00
Saran Tunyasuvunakool 94b6ae2b69 Bump version number to 2.2.2.
PiperOrigin-RevId: 472513958
Change-Id: I42f321c6681fdd42c5f80368f612534aa885af74
2022-09-06 11:32:55 -07:00
Alessio Quaglino d26501c0f3 Add two new attributes to weld constraints:
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.

PiperOrigin-RevId: 470021901
Change-Id: I3faba0e5dcab2e29ee81096f5ff71ff66d99758c
2022-08-25 10:22:15 -07:00
Alessio Quaglino abc0a39b7a Add two new attributes to weld constraints:
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.

PiperOrigin-RevId: 469228149
Change-Id: I836b0791f10fb624607a12ef3c687da991c21789
2022-08-22 10:46:46 -07:00
Alessio Quaglino 8ca5887c20 Add two new attributes to weld constraints:
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.

PiperOrigin-RevId: 469190483
Change-Id: I20f6da85b09cd2c4c0b5d29eb8003eabb524e55e
2022-08-22 08:19:22 -07:00
Yuval Tassa c8ff7b3d34 Remove distance constraints.
- `distance` constraints were not very useful and increased the contact buffer within the constraint solver, violating a core design principle. Therefore they have been removed.
- The enum value `mjEQ_DISTANCE` is retained, but errors will be thrown in the parser and engine if these constraints are selected.

PiperOrigin-RevId: 467050101
Change-Id: Ie72a07e4fe338eea5107004a9fc0f5e47eb0c3b7
2022-08-11 14:31:11 -07:00
Levi Burner 581f009c02 Cull face flag 2022-08-05 11:53:46 -04:00
Yuval Tassa b966a37855 Add optional azimuth and elevation to initial free camera.
- Add `azimuth` and `elevation` to `visual.global`.
- Add `mjv_defaultFreeCamera`.
- Use `mjv_defaultFreeCamera` in `simulate`.

PiperOrigin-RevId: 465505244
Change-Id: I61e60f14a990d4e2d220958adb75c325001978ee
2022-08-05 01:04:02 -07:00
Tom Erez 151449c47a binary retriever is only relevant for the Editor.
PiperOrigin-RevId: 461629986
Change-Id: Ib2e27bdf30c1fb696773b8d05b3e42a6adc3e0fe
2022-07-18 08:47:03 -07:00
Tom Erez e8a9db82b8 Retrieve the binary only when the MuJoCo package is installed.
PiperOrigin-RevId: 461524833
Change-Id: Ie8ca9dda71b35262f99688d02f71be77c251ea3e
2022-07-17 20:48:06 -07:00
Tom Erez 26a0441e7c add a script that converts MJCF models to PhysX.
PiperOrigin-RevId: 461520759
Change-Id: I177195af60645169294180da8b99740426d23d8f
2022-07-17 20:08:31 -07:00
Saran Tunyasuvunakool 373cc894a8 Bump version number to 2.2.1.
PiperOrigin-RevId: 461471944
Change-Id: Ia752d992fabdc57b822bc30b01030c19162917ac
2022-07-17 09:50:31 -07:00
Yuval Tassa 09a5efc09e Add control values to keyframes.
- Add basic test for keyframes.
- Add missing documentation for keyframe mocap positions and quaternions.

PiperOrigin-RevId: 459021649
Change-Id: I91cf7ecbddc6262e8c72a868eeb82d627f389fb3
2022-07-05 01:07:37 -07:00
Tom Erez 3df3c95812 Update C# bindings.
PiperOrigin-RevId: 458919739
Change-Id: I7737d2736491dae8fce46bc36aa5135007a7a588
2022-07-04 08:47:29 -07:00
Alessio Quaglino 307cf692e5 Add <damper> actuator shortcut and related mjGAIN_AFFINE.
**Rationale**

A general `mjGAIN_AFFINE` actuator adds the term `force = (c + kp * length + kv * velocity) * ctrl`. The damper shortcut restricts it to `kv * velocity * ctrl` and sets the `ctrllimited` attribute to true.

**API**

```xml
<actuator>
  <damper ctrlrange="0 1" kv="1"/>
</actuator>
```

* Required attributes: `ctrlrange` (>=0)
* Optional attributes: `kv` (>=0)

PiperOrigin-RevId: 455366866
Change-Id: I88773abbeccabb6442f215c9fc05e205df63f692
2022-06-16 06:21:17 -07:00
Tom Erez 02f300c762 Refactor: separate buffer indexing and swizzling.
This also fixes a sensor data reading bug: previously, _sensorIndex was multiplied by 3 by MjEngineTool.

PiperOrigin-RevId: 451699887
Change-Id: I864bcbf8159857764854b25311a26ec5672125d9
2022-05-29 00:24:30 -07:00
Tom Erez ef9fa9dfe4 Get rid of the opaque "entryIndex" argument.
Use pointer arithmetic instead.

PiperOrigin-RevId: 451493057
Change-Id: Ic89ad8ff1d3191180031a1011c1b100eaea12f6f
2022-05-27 15:24:22 -07:00
Copybara-Service dee54ede2a Merge pull request #275 from jespersmith:feature/UnityFixes
PiperOrigin-RevId: 450975561
Change-Id: I06deabfa19dd7649cf465bfb529206266371d5cc
2022-05-25 11:39:29 -07:00
Saran Tunyasuvunakool 1913a02b40 Initial open sourcing of MuJoCo.
PiperOrigin-RevId: 450374687
Change-Id: Ie3225a46ce095fc28ae8e63c326a640261f562bb
2022-05-23 01:08:49 -07:00
Jesper Smith a83a8f642f Add priority settings to geometry 2022-05-13 17:40:11 +02:00
Jesper Smith c62c68d744 Fixed reading offsets for Sensors. Added Advanced Settings property to MjGeomEditor 2022-05-13 13:32:40 +02:00