Commit Graph

842 Commits

Author SHA1 Message Date
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
Kyle Bayes f8b944bf7f Fix missing fclose when resource is closed without being read. Fixes #1685.
PiperOrigin-RevId: 649416747
Change-Id: I05eeb1071868116b6e5be76e26b465788e4d35b1
2024-07-04 08:07:34 -07:00
Kyle Bayes d831153401 Reorganize GJK support logic.
PiperOrigin-RevId: 649361144
Change-Id: I9868377cf36cccdcf66de3bc27afb872a164da8d
2024-07-04 03:48:52 -07:00
Tom Erez 3b73dfe33b Add textured materials to render context, and refactor mjvGeom to refer to those textures.
PiperOrigin-RevId: 648719103
Change-Id: Idb4425bdeea3cbc1133cda3e4366574ed3bb5ccc
2024-07-02 08:01:40 -07:00
Yuval Tassa 0c3698f278 Don't normalize mocap quaternions in-place.
PiperOrigin-RevId: 648394295
Change-Id: I348a0a045c1697f6ef782280d92c90a30759eb33
2024-07-01 09:29:50 -07:00
Yuval Tassa 4d4b0bb2c3 Don't normalize mjData->qpos quaternions in-place.
PiperOrigin-RevId: 647927542
Change-Id: I13b0be55498d1da3af2cdc414cfed4c3908a6fe1
2024-06-29 03:07:10 -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
Yuval Tassa 62e2842116 Skip deprecated mju_rotVecMat and mju_rotVecMatT in Python bindings.
PiperOrigin-RevId: 647275284
Change-Id: I371236182b22eb399041959901085bb82af3f670
2024-06-27 05:06:01 -07:00
Kyle Bayes 5e39fc0564 Improvements to GJK implementation:
- Fix various bugs
- Improve readability
- Add support for recovering witness points.

PiperOrigin-RevId: 646515019
Change-Id: I295cf90d885e32013e595ea7aad07ed6c1869239
2024-06-25 10:00:58 -07:00
Kyle Bayes 14fe527ea2 Fix small typo/bug in gjk implementation.
PiperOrigin-RevId: 645378191
Change-Id: Icdba53b30c934ac3059bb6f7b6d1081d71823131
2024-06-21 07:04:22 -07:00
Kyle Bayes 1e8454820d Implement initial GJK algorithm.
PiperOrigin-RevId: 645368315
Change-Id: I40a1e1023fd9f14a59e11a9dcc6ac22df241b6ae
2024-06-21 06:17:43 -07:00
Kyle Bayes b0b934cb5f Separate CCD code from support/center logic.
PiperOrigin-RevId: 645355865
Change-Id: I71303ffd7bbee37c5e8ac7e770f810768780c2e6
2024-06-21 05:17:57 -07:00
Yuval Tassa 3f3b39bbb1 Fix type-related issues in dependent code. Remove hardcoded mjUSEDOUBLE. Add mjUSESINGLE compiler flag.
This CL does not change the default build behavior of MuJoCo. To use single-precision floating-point, build MuJoCo with `-DmjUSESINGLE`.

PiperOrigin-RevId: 644782648
Change-Id: Ie815df9916798ca8054306437b39a33f84ce9e08
2024-06-19 10:52:18 -07:00
Yuval Tassa 19388eee0c Fix type errors in engine and plugins.
- Preparation for a float32 build of MuJoCo.
- Fix use of `float`-typed `fabs` in `mju_eig3`.

PiperOrigin-RevId: 643804942
Change-Id: I89f64e8fd39f4e70e78d7607816283e217912383
2024-06-16 12:35:05 -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
Yuval Tassa c9bcf8371e Add mj_setKeyframe function to save current state in k-th model keyframe.
Fixes #1719.

Also improve documentation of `mju_sigmoid`, was previously only documented in changelog.

PiperOrigin-RevId: 642637458
Change-Id: I811a0bf8f881c8b76c9a62d2faec8fdec4e7585b
2024-06-12 09:22:52 -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 ba8a2d4c8a Dynamic model editing.
PiperOrigin-RevId: 640838852
Change-Id: I559b1d60f2a3a2d866788d4006be31757454c619
2024-06-06 03:30:59 -07:00
Meghha Dhoke 1bf90af0e0 Bumping mjVERSIONSTRING from 3.1.6 to next version 3.1.7
PiperOrigin-RevId: 639959152
Change-Id: I7b88bae6ea56b0173f00c6f0899ba4a156614f01
2024-06-04 15:27:47 +01:00
Yuval Tassa 2830a4071f Add dampratio attribute to position and intvelocity actuators.
PiperOrigin-RevId: 639745135
Change-Id: I94ba4c346d2750c6c454a60a568f2e6f6bce19d4
2024-06-03 05:28:35 -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
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
Kyle Bayes 0108b7b569 Group CCD common initialization options together.
PiperOrigin-RevId: 635896664
Change-Id: Ib3135b1137484df5606a0377052c7db001b746c9
2024-05-21 12:45:58 -07:00
Kyle Bayes 2f19941fcf Move mj_loadModel to xml_api.cc.
PiperOrigin-RevId: 635748029
Change-Id: Ie4c7d34c9738e5497ec700089d4dba780ba7d5ed
2024-05-21 03:37:24 -07:00
Kyle Bayes f6f9ff537b Wrap LibCCD MPR function in a macro and initialize ccd_t struct.
PiperOrigin-RevId: 634556417
Change-Id: I6a980e9b86c082523758fa401fbc75fcdc798c6b
2024-05-16 16:00:23 -07:00
Yuval Tassa 65d4f04cd4 Add some missing const qualifiers.
PiperOrigin-RevId: 632463634
Change-Id: Id3e3e53371f8ed53d970ad7c471bbefd2a70cf5a
2024-05-10 05:20:37 -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
Meghha Dhoke 4eca3b048d Bumping mjVERSIONSTRING from 3.1.5 to version 3.1.6
PiperOrigin-RevId: 631544334
Change-Id: Iadf8fa25e30da5b00172c8212786b1f9edb22e1a
2024-05-07 14:11:38 -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
Alessio Quaglino ec84ddb5a4 Use plane-convex for plane-sdf collisions, using the marching cube mesh.
PiperOrigin-RevId: 629437563
Change-Id: Ic7fb6ec8a5c6680dd2c0a71baa7cc78636d478b1
2024-04-30 09:30:39 -07:00
Yuval Tassa 3ddf1b492a Fix control reaches end of non-void function in engine_forward.c
PiperOrigin-RevId: 627104708
Change-Id: I790b2bd22fd83ed616605a35f3e7268e28c73aa6
2024-04-22 11:36:39 -07:00
Yuval Tassa 8ebc9ed2c8 Add mjModel.ngravcomp, number of bodies with nonzero gravcomp attribute.
PiperOrigin-RevId: 627087335
Change-Id: Ie85ae4150962463b8a8c8435fec068c44877aa16
2024-04-22 10:45:43 -07:00
Yuval Tassa 546a27ca72 Fix memory allocation error when memory size is larger than 2G. Fixes #1606
PiperOrigin-RevId: 627058355
Change-Id: Iebef647a0107d1f112a876d705f5b3ea888b4a41
2024-04-22 09:15:46 -07:00
Yuval Tassa caf215e342 Add metallic and roughness scalar attributes to materials.
Rename `light_radius` -> `light_bulbradius`, make the default value 0.02.

PiperOrigin-RevId: 627032170
Change-Id: I1e01e2eca028c0aefc2e7dc384e8b34abac184aa
2024-04-22 07:39:06 -07:00
Yuval Tassa 7c86a02a80 Improve printing of geom/geom contacts.
PiperOrigin-RevId: 625338796
Change-Id: I89267c3512c0ab28c0e1d35c571fd4d4bafa9b43
2024-04-16 08:25:02 -07:00
Yuval Tassa 7b3f1a0261 Add mjModel.mesh_scale: scaling applied to asset vertices.
PiperOrigin-RevId: 625083195
Change-Id: I36290282379e57ad23ec771d65d1bd6bf2a75b07
2024-04-15 14:26:06 -07:00
Gabe Oppenheimer 225619c964 Update MuJoCo internal version to be the external version +1
PiperOrigin-RevId: 623607403
Change-Id: Ia8f6516bb6b2fb6a3ecb8273b59e61667098f308
2024-04-10 14:32:54 -07:00
Yuval Tassa 5a365603f8 Add mju_euler2Quat.
PiperOrigin-RevId: 623469398
Change-Id: Ia86b29a764018cd4c3bc57d23616bed7393081f5
2024-04-10 06:02:50 -07:00
Yuval Tassa 5d26b50fce Remove native sensor noise sampling.
PiperOrigin-RevId: 620075316
Change-Id: I6a0a1d63834e7c8bfd290f89d86fea791d794739
2024-03-28 15:33:03 -07:00
Yuval Tassa 47ba72ea59 Add actuatorgravcomp joint attribute, to treat gravity compensation forces as applied by actuators, rather than passive buoyancy.
PiperOrigin-RevId: 620049593
Change-Id: I2c8a9dc152c087b408e4f904838034271a7dd910
2024-03-28 14:01:52 -07:00
Yuval Tassa a8db22f0d0 Add local vector clamping function in engine_forward.c
PiperOrigin-RevId: 619948315
Change-Id: Ie4b92f5c8facaa2c169f01982940e84a0248b9c9
2024-03-28 08:57:34 -07:00
Alessio Quaglino e6bf6fc327 Fix a bug in the ellipsoid SDF gradient.
PiperOrigin-RevId: 619512430
Change-Id: Ia4c2f01d1767f36313177334ceda02d3a9e2e495
2024-03-27 06:35:40 -07:00
Yuval Tassa fa8893b443 Improve hash function for names.
PiperOrigin-RevId: 619173787
Change-Id: I7889ea71ebe7bdbe682042842c521d6631521a35
2024-03-26 06:51:31 -07:00
Yuval Tassa bb42ff1657 Fix order of enable flag strings. Before this change, using the UI to toggle the "InvDiscrete" and "Sensornoise" flags would toggle the opposite flag.
PiperOrigin-RevId: 618658133
Change-Id: I35d4b9da2fdf68fed24efd518a30af60d3a806eb
2024-03-24 13:13:21 -07:00
Alessio Quaglino acaf86a96f Fix input array size in mju_mulMatMat3.
PiperOrigin-RevId: 616802192
Change-Id: I4dbc07d392b23a7014331ab850b685c1b82d3dcf
2024-03-18 06:00:45 -07:00
Yuval Tassa dd2580e546 Add internal functions for 3x3 matmul.
PiperOrigin-RevId: 616749614
Change-Id: I7f3ac2ffc826076b6c97424324f03ecd9ccd4655
2024-03-18 01:44:10 -07:00
Yuval Tassa bf66801bc9 Move printing of model BVH data to the end, make it more compact.
PiperOrigin-RevId: 616186922
Change-Id: Id6368a5efd831698f182fe97251b9608312c663c
2024-03-15 11:10:15 -07:00
Kyle Bayes c7a8b104f9 Add modified callback for VFS resource provider.
PiperOrigin-RevId: 616152275
Change-Id: I417f9b204eaa1eb9fc68a15927f86031dcd20575
2024-03-15 09:23:29 -07:00
Kyle Bayes c42868a91b Update logic for OS filesystem timestamps for caching.
PiperOrigin-RevId: 616138153
Change-Id: I0ce966546bc4af04e57b983e27bbd75a94377237
2024-03-15 08:31:56 -07:00