Commit Graph

322 Commits

Author SHA1 Message Date
Yuval Tassa b483ce608e Use std::thread in compiler on all platforms.
PiperOrigin-RevId: 651005412
Change-Id: I8dfb142dc2d87ab0af79583f2df168c105b50138
2024-07-10 07:10:45 -07:00
Alessio Quaglino 462cfa5ceb Attach the tree of defaults recursively and with namespacing.
PiperOrigin-RevId: 650664018
Change-Id: I17751a02a406dcb2a2ca218c316b5eb0370071b8
2024-07-09 09:54:09 -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
Alessio Quaglino e0d33eb1d0 Remove mjCBase::def and use mjCBase::classname instead.
PiperOrigin-RevId: 650629741
Change-Id: I10a9955b99e4a5ff0b5a742e22635ccad1455f1a
2024-07-09 08:02:32 -07:00
Nimrod Gileadi c5f958bdff When reporting compilation errors, include warning strings.
This allows plugins to call mju_warning, and have the string propagate to users.

PiperOrigin-RevId: 650621601
Change-Id: I608e7a3a1ad126ab8da2ff0634fa708458fb9ccc
2024-07-09 07:33:11 -07:00
Kyle Bayes 450e7ff777 Move user_resource.c to C++.
PiperOrigin-RevId: 650592110
Change-Id: I5e043970e3aa722e3961e478334cad4f3f1c191e
2024-07-09 05:33:38 -07:00
Alessio Quaglino f57dc90669 Refactor Default class to use pointers instead of indices.
This in order to make it easier to append the default tree to another tree.

PiperOrigin-RevId: 649812975
Change-Id: I2915ac7e37957e45eadc24d6caaf7beea236bf29
2024-07-06 03:51:30 -07:00
Kyle Bayes c6fd002f87 Move engine/engine_resource.{c,h} to user/user_resource.{c,h}.
PiperOrigin-RevId: 649628768
Change-Id: Id90c983cf70c0f92c3b033ac1b1654c53696955d
2024-07-05 05:41:55 -07:00
Kyle Bayes 57e6760ec9 Re-implement VFS internals in C++, removing the constraints of the previous implementation.
PiperOrigin-RevId: 649433087
Change-Id: Icaa3e6b7f2ef14f56b04fef2f4360b46d8b5f022
2024-07-04 09:22:23 -07:00
Alessio Quaglino a5a3c9efc7 Discard all keyframes when attaching models.
PiperOrigin-RevId: 649415647
Change-Id: Ie2defe248df7078684d987351985cb66bd754e5b
2024-07-04 08:04:40 -07:00
Alessio Quaglino a0945e4b5a Add non-tree element lists to python bindings.
Fixes #1752.

PiperOrigin-RevId: 649405039
Change-Id: Ie0b575a3ec912b773141694397ac2f394bff1227
2024-07-04 07:24:02 -07:00
Kyle Bayes 5cce67439b Clean up user_util.
PiperOrigin-RevId: 649166858
Change-Id: I79423dda628fb4bf3ceae438dd8dc5b96d69d2a9
2024-07-03 12:38:36 -07:00
Kyle Bayes 2a4410e4e5 Fix bug with absolute meshdirs in included XML files. Fixes #1772.
PiperOrigin-RevId: 649150979
Change-Id: I5df08c689afc4f5bc625e989a8c0b9733fcfa3c2
2024-07-03 11:49:17 -07:00
Alessio Quaglino 9107d3b507 Add mjs_findKeyframe.
PiperOrigin-RevId: 649036650
Change-Id: If514d5c333dd6084af9509324fd658c72576d7b5
2024-07-03 05:17:41 -07:00
Yuval Tassa 8f16b72f44 Rename mjSpec.euler to eulerseq to match MJCF.
PiperOrigin-RevId: 649007737
Change-Id: Iedb53c1d8a6e6a082a6ba30a1fb2bb4516839fa1
2024-07-03 03:10:02 -07:00
Tom Erez df7ea3ed33 Add support for multiple textures in one material (mjModel).
PiperOrigin-RevId: 648732764
Change-Id: I29b60dd62a069789a32017ff0d55e36b57e0052b
2024-07-02 08:50:23 -07:00
Yuval Tassa af3233f98d Delete unused code.
PiperOrigin-RevId: 648658198
Change-Id: I1bec6b07becd7cec22af4c67e9cc1a9bcda669b0
2024-07-02 03:32:55 -07:00
Alessio Quaglino 9106f40e2b Add mjSpec bindings.
Co-authored-by: Saran Tunyasuvunakool <stunya@google.com>
PiperOrigin-RevId: 648444641
Change-Id: I08ee1d3f4fae1efbc7934ba94702b1c06d8cb92a
2024-07-01 12:05:50 -07:00
Yuval Tassa f2c3be470f Make seed fixed for random number generator when using <texture mark="random"/>
Also improve documentation regarding texture height and width attributes.

PiperOrigin-RevId: 648427167
Change-Id: I59a0fe75d3526f8563a5252584ed60ef7fb8fd70
2024-07-01 11:11:17 -07:00
Saran Tunyasuvunakool 0e19722c61 Split name2id and id2name into a separate source file.
PiperOrigin-RevId: 647373431
Change-Id: I3bab0ea7157750b79826739e3d739e4114fa0af7
2024-06-27 10:50:21 -07:00
Alessio Quaglino f6cc3f4091 Remove classname from mjs* structs.
PiperOrigin-RevId: 647277317
Change-Id: Ic3cb0d3bf890d6be2712c0538e21910a8f12ab44
2024-06-27 05:13:02 -07:00
Alessio Quaglino 6be4e0697e Simplify mjs_addDefault.
PiperOrigin-RevId: 646534046
Change-Id: I658224e4800849231e68ed02d8fad07b8d796231
2024-06-25 10:51:57 -07:00
Yuval Tassa d8b85245a7 Informative error if mis-naming the top-level default class.
Also:
- Move the the top-level default class name into the mjCModel constructor.
- Fix bug in default class propagation in frame elements.
PiperOrigin-RevId: 646384669
Change-Id: Icc6154124361a234b84a07e2b5ecaa7c8b18ebf7
2024-06-25 01:46:18 -07:00
Kyle Bayes e66b9a36b2 Remove mj_makeEmptyFileVFS and mj_findFileVFS from MuJoCo API.
PiperOrigin-RevId: 645393666
Change-Id: Iabe939c88f60b80dce20f84c7ff9a6396717cc84
2024-06-21 08:12:51 -07:00
Alessio Quaglino 7bd7065e0e Renamed mjs_fullInertia to mjuu_fullInertia and moved it to user_util.
PiperOrigin-RevId: 644769379
Change-Id: I83511eeb4c0972ce9f46f0e3443d438cccdd4d9f
2024-06-19 09:39:02 -07:00
Yuval Tassa 8e2f830fd2 Fix type errors in compiler and tests.
In preparation for a float32 build of MuJoCo.

PiperOrigin-RevId: 644407674
Change-Id: I60069f0f865ef89fbf613f5a2ca0c336cc63461e
2024-06-18 09:12:44 -07:00
Alessio Quaglino f15b6e5e21 Set orientation type in composite box. Fixes #1732.
PiperOrigin-RevId: 643937520
Change-Id: I9ba9d9a8feae6815df35c5d21b0314165713c9d6
2024-06-17 03:07:16 -07:00
Yuval Tassa 6067048537 Deprecate mju_rotVecMat and mju_rotVecMatT in favor of mju_mulMatVec3 and mju_mulMatTVec3.
These functions names and argument ordering are more consistent with the rest of the API.

PiperOrigin-RevId: 643788290
Change-Id: I783eda8021b80b82098e23ed95669b102bb82508
2024-06-16 10:02:36 -07:00
Tom Erez 739512a0e4 Fix comment typos.
PiperOrigin-RevId: 643762423
Change-Id: I98289ed4053e635b863b029f239b14a232e505e3
2024-06-16 05:54:33 -07:00
Yuval Tassa 07fc95ca9a Add orthographic cameras.
Orthographic cameras are specified by setting the `orthographic` attribute of the `<camera>` element. The `fovy` attribute is still used to specify the field-of-view, but its semantic is different for orthographic cameras. For orthographic cameras, the field-of-view is expressed in units of length, rather than degrees.

Other related changes:

* Fix bug in the ordering of `cam_xxx` elements in `mjModel`.
* Make camera visualization translucent only when the frustum is visualized.
* Added a button to `simulate` to toggle between perspective and orthographic free cameras.

https://youtu.be/ZXBTEIDWHhs

PiperOrigin-RevId: 642293435
Change-Id: Id090a421ad88ab404b5b27ddbbd6bfc81ad49bc5
2024-06-11 09:23:18 -07:00
Alessio Quaglino 7a06bcfdaf Make model editing API public, fixes #364
Still missing:

- Detailed documentation.
- Python bindings.

PiperOrigin-RevId: 641445626
Change-Id: I20e67b707cf1bebae7e0cc94d17f7b76a89171f0
2024-06-07 22:28:01 -07:00
Baruch Tabanpour ace0c8f0a3 Add maxhullvert.
PiperOrigin-RevId: 641092710
Change-Id: Ib4fa828a9c82531614f0a67de9990340dbb25406
2024-06-06 19:05:16 -07:00
Alessio Quaglino f6084b4328 Change user_api handle types.
PiperOrigin-RevId: 640978033
Change-Id: I53496671ac823b50e6f90ceee15bf3b314b06db8
2024-06-06 12:06:10 -07:00
Alessio Quaglino 9a140bad14 Use suffix instead of prefix underscore for private members in user_api.h.
PiperOrigin-RevId: 640866779
Change-Id: Ifab04d8cdfe7e4c416d1916eb66f7d3584259f30
2024-06-06 05:44:12 -07:00
Alessio Quaglino ba8a2d4c8a Dynamic model editing.
PiperOrigin-RevId: 640838852
Change-Id: I559b1d60f2a3a2d866788d4006be31757454c619
2024-06-06 03:30:59 -07:00
Alessio Quaglino 14a3ce5ffa Add tree traversal utilities to C API.
PiperOrigin-RevId: 639285787
Change-Id: Ieb52da87fb5e1c674985f03c9ff2b18783d1d657
2024-06-01 01:28:13 -07:00
Alessio Quaglino 936866be0f Add mjModel and mjData arguments to mj_makeModel and mj_makeRawData. If they are NULL, then the functions allocate the memory, otherwise they will use the memory allocated by the caller.
PiperOrigin-RevId: 639283021
Change-Id: I765f95fe1b5c27202ae033b05a13ae7b5fb8dbc3
2024-06-01 01:08:56 -07:00
Alessio Quaglino b38998eff2 Replace mjs_deleteBody with mjs_delete.
PiperOrigin-RevId: 639058333
Change-Id: I9ac9ca8c6b8c0219f0130cd65dc83602f1829684
2024-05-31 09:24:59 -07:00
Alessio Quaglino dec55b59fa Allow detaching from a compiled model.
PiperOrigin-RevId: 638299270
Change-Id: I944d2a24578b63463eddfa55d89f39fcfbafd2b4
2024-05-29 08:47:30 -07:00
Kyle Bayes 50aab2dd48 Move engine/engine_vfs.{c,h} to user/user_vfs.{c,h}.
PiperOrigin-RevId: 636219666
Change-Id: I820de511948e82256784edb0893f209a73b221e6
2024-05-22 10:44:53 -07:00
Tom Erez 727893f0f2 Add timeconst attribute to position actuator.
PiperOrigin-RevId: 635018979
Change-Id: I919573f4241ecb4a4c61c3b8b6641b31aa79eca4
2024-05-18 03:38:20 -07:00
Kyle Bayes e885a3dc3d Make default class members private.
PiperOrigin-RevId: 634288934
Change-Id: I1b7a5ec8dd51c65377b09bcb85c56a849573cac7
2024-05-16 03:22:31 -07:00
Yuval Tassa 02d015458c Add mj_geomDistance API function and sensors for geometric distance, normal direction and segment between between two geoms. Fixes #51
PiperOrigin-RevId: 632458301
Change-Id: I65b7e5bb0df59008028114cf4a07e0d6365ff3d3
2024-05-10 04:52:43 -07:00
Yuval Tassa 39601b0f52 Fix bug in compiler error string construction.
PiperOrigin-RevId: 632404023
Change-Id: I79e24e44fc4eec67b76fbf62b053b169ba3070a3
2024-05-10 00:40:07 -07:00
Kyle Bayes 13bf9ae6bd Encapsulate mjCModel internal lists.
PiperOrigin-RevId: 631760335
Change-Id: I9b67f6ed2e65a01877de15a92a04a1b31a6b3ff4
2024-05-08 05:02:21 -07:00
Alessio Quaglino 96844db926 Update BVH during fusestatic. Fixes #1069 and #1577.
PiperOrigin-RevId: 631748750
Change-Id: I4e1ae01207568c90fc49bcd7d9f760f5187f1afa
2024-05-08 04:13:16 -07:00
Kyle Bayes dbb258eb69 Fix compile-time size_t narrowing to bool.
PiperOrigin-RevId: 631381101
Change-Id: I5188c352354573476decb8ae6bc007faf623a884
2024-05-07 05:00:15 -07:00
Kyle Bayes ad0459680d Enable compiler asset cache for public use, and add changelog entry.
PiperOrigin-RevId: 631352810
Change-Id: If6208327499e3e4bd37cbb2a1b0cdcfb912c1056
2024-05-07 02:50:50 -07:00
Yuval Tassa ac1af8e461 Remove urdfeffort attribute, parse URDF "effort" into mjsJoint.actforcerange.
PiperOrigin-RevId: 630796429
Change-Id: I45363aca8afcce68bf48b2e8bdb556b39852f073
2024-05-05 03:28:22 -07:00
Kyle Bayes 61a651c63a Fix uninitialized variable error in asset cache.
PiperOrigin-RevId: 630491063
Change-Id: If5ac05beaee28b38975845682b92a9cb767f009b
2024-05-03 14:00:59 -07:00