Commit Graph

124 Commits

Author SHA1 Message Date
Saran Tunyasuvunakool 49a3caf84c Modify SimulationState proto to correspond to mj_getState.
PiperOrigin-RevId: 823494487
Change-Id: Ib284e3165ca691f5b690a376f7b28e51122e1bc4
2025-10-24 05:51:07 -07:00
Haroon Qureshi 1fd9b47fea Prefix assets path with "assets/".
PiperOrigin-RevId: 823044312
Change-Id: I0bde4428bd1992d6d4356e107dac471fa7cdecc6
2025-10-23 08:07:33 -07:00
Sam Haves febe75d54b Add tendon.cpp to mjcPhysics CMake
PiperOrigin-RevId: 822694422
Change-Id: Ic2f7c7a3b85526d49eb98c19118e6936ccb4e0f7
2025-10-22 12:30:16 -07:00
Sam Haves ae33724de1 Set info string on wrap instead of tendon when wrapping a prim in the path.
PiperOrigin-RevId: 822688877
Change-Id: I04f5f5576cc0ed43e0ec77d5fccb19d2d23d7349
2025-10-22 12:13:53 -07:00
Sam Haves 160b9480f9 Add support for tendons to mjcPhysics.
PiperOrigin-RevId: 822230926
Change-Id: I232a9fbfb473186ac742d210458ff0221a561126
2025-10-21 12:30:12 -07:00
Kyle Bayes 25f5be82ff Provide option to disable keyboard events for SDL.
PiperOrigin-RevId: 822154396
Change-Id: Ie4c8537de2c4b01437aae00ed6d6af1a8f419a73
2025-10-21 09:36:16 -07:00
Sam Haves 09682ade4b Fix mjcPhysics island flag default.
PiperOrigin-RevId: 822088739
Change-Id: If3a87976dd319502160fd886a1823c12d72bebf1
2025-10-21 06:27:28 -07:00
Matija Kecman 88ac02dad3 Add UI to visualize the State
PiperOrigin-RevId: 821641514
Change-Id: I41fd5602d0d52162b374149fb0080f6c387d7847
2025-10-20 07:32:41 -07:00
Haroon Qureshi e75c5aa83c Fix various include paths.
PiperOrigin-RevId: 821564663
Change-Id: Ic84489b7f3e1ba97810f60049dcf2f4a4d31edcf
2025-10-20 02:55:22 -07:00
Haroon Qureshi 87adb7e5d6 Use the ImGui OpenGL3 backend.
PiperOrigin-RevId: 820249390
Change-Id: I43fc85bf75a2c01b76218a2ff67a1526ee9e2bdb
2025-10-16 08:39:51 -07:00
Haroon Qureshi 9174c87203 Minor fixes.
PiperOrigin-RevId: 819680566
Change-Id: Ie2480eab3c974227268222190fdb84ed671303f2
2025-10-15 04:07:36 -07:00
Haroon Qureshi 9b7e7e471d Add line and linebox geom primitives.
PiperOrigin-RevId: 818570050
Change-Id: If02873dd878a23b442368ce69bc024e0310e9d02
2025-10-13 02:59:13 -07:00
Haroon Qureshi b63252e4bb Render labels for any geom with a label, not just label geoms.
PiperOrigin-RevId: 817686605
Change-Id: I030626dd942e50eef33e0de7e9d0f314fd2f457d
2025-10-10 09:58:21 -07:00
Haroon Qureshi ff7c613c79 Initial implementation of the filament rendering backend for mujoco.
This is intended as a drop-in replacement for mjr_render to enable high
quality, physically-based rendering (PBR) using the filament render engine.

This is a work-in-progress and, as such, some features may be missing. This
is also a code-only drop; build files (including instructions on how to
generate the filament materials) will be provided at a later date.

This library is intended to be run with the experimental studio app.

PiperOrigin-RevId: 817593684
Change-Id: Ib9cd14c1881e4897c1111275bd749aa38ebb5317
2025-10-10 05:01:39 -07:00
Matija Kecman 59a5a7bf5f Improve error messages in LoadMujocoModel
PiperOrigin-RevId: 817565307
Change-Id: I367298cdf77d26b6f8deb5c6a0d5c3cab1e4d065
2025-10-10 03:24:50 -07:00
Sam Haves 3a299c49ca Remove use of usdaFileFormat from mjcf_file_format.
Previously this was just used for the USDA file format token, which we can confidently just construct ourselves.

Since [this PR in OpenUSD](https://github.com/PixarAnimationStudios/OpenUSD/commit/5bb9ad1fb2a034e1f9b48c7db936f296b5b78e25) the file lives in a different place now and public usage will be deprecated anyways.

PiperOrigin-RevId: 816801204
Change-Id: I42e92d2af52b0f9ff0a679ecb96f3d2dbf623531
2025-10-08 11:54:44 -07:00
Haroon Qureshi 1335ec87e4 Move font assets data targets into toolbox library.
PiperOrigin-RevId: 816654994
Change-Id: Ic56fab2b0af0c8d85682f8b233342a0d088d5cca
2025-10-08 05:09:42 -07:00
Haroon Qureshi fbab761627 Cleanup how different rendering backends are selected.
PiperOrigin-RevId: 816169098
Change-Id: I915aa45fa3a6d45a5178d3ff7bfdd0f1b1e01789
2025-10-07 17:48:23 +01:00
Yuval Tassa 431f96572e Remove unused mjOption.apirate.
PiperOrigin-RevId: 815633571
Change-Id: Ib98f3eb2df47f96fa1fe6e987a3a0cd23a9479f6
2025-10-06 02:51:17 -07:00
Sam Haves b5c35f87fc Add material parsing path for colliders instead of strictly visual gprims.
PiperOrigin-RevId: 814692421
Change-Id: If92a36d0382f60e0d92c7d90320dec51c20ea739
2025-10-03 07:52:55 -07:00
Sam Haves c439628f82 When parsing USD, infer gravity from stage metadata if UsdPhysicsScene missing or undefined.
PiperOrigin-RevId: 813705210
Change-Id: I13741af6dc87ecd9efb83219e978f5f06c72d021
2025-10-01 05:19:31 -07:00
Haroon Qureshi e1c7e19780 Add rendering flags to the studio UI.
PiperOrigin-RevId: 812649785
Change-Id: I47c6f974b7336bdd63c088ccfd06b5835e77ebff
2025-09-28 23:58:33 -07:00
Haroon Qureshi bb0878417e Automated g4 rollback of changelist 810355812.
*** Reason for rollback ***

mjv_makeScene does not call mjv_defaultScene directly.  Instead, it calls mjv_freeScene which calls mjv_defaultScene.  However, mjv_freeScene attempts to free pointers if they are not NULL and if you don't call mjv_defaultScene then you'll have garbage data in those pointers.

*** Original change description ***

Remove redundant mjv_defaultScene call since its called by mjv_makeScene

***

PiperOrigin-RevId: 810442645
Change-Id: Ica50493d6769a0afb086f9ead99d731cdf0d75d9
2025-09-23 08:05:40 -07:00
Matija Kecman bf918ccf40 Remove redundant mjv_defaultScene call since its called by mjv_makeScene
PiperOrigin-RevId: 810355812
Change-Id: I2bc112e24c3adaca616604ebc5c1e3e3c494eb59
2025-09-23 02:35:05 -07:00
Haroon Qureshi 6eea3d8ec0 Initial implementation of toolbox-based "Studio" app.
PiperOrigin-RevId: 809966748
Change-Id: Ic6333259ca1d112a2e42d47ccc44326bfcea3bdd
2025-09-22 05:02:31 -07:00
Kyle Bayes eb96dd556c Reduce ccd_iterations from 50 to 35.
PiperOrigin-RevId: 808610578
Change-Id: I8755f9ba2902bf0805b7ded07ee6e048e404a31f
2025-09-18 09:16:52 -07:00
Matija Kecman f9f3dd3c1d Fix ImGui input processing
PiperOrigin-RevId: 808555760
Change-Id: Ie443143d9c058058b99786e44f27715b05c9f8ed
2025-09-18 06:42:16 -07:00
Haroon Qureshi 6f5a7576f9 Move simlib into experimental folder and rename it toolbox.
Also:
- update the namespace to `toolbox` (instead of `filament`)
- Add copyright notices to all files
PiperOrigin-RevId: 808474353
Change-Id: Id1fe86c5d183c8e91bec8509b6c0830b5fe84c1c
2025-09-18 02:15:23 -07:00
Yuval Tassa b092563cab Remove mjDSBL_PASSIVE, split it into mjDSBL_SPRING and mjDSBL_DAMPING.
PiperOrigin-RevId: 800870384
Change-Id: I273e0ceec090901e2620febb67e57914928e94bb
2025-08-29 06:06:28 -07:00
Yuval Tassa 643dc5bf4f Update USD schema formatting
PiperOrigin-RevId: 800018484
Change-Id: I7677cd099415af1271c7475d80a660653199b984
2025-08-27 07:02:50 -07:00
Yuval Tassa ec94bb49aa Make constraint island discovery on by default.
Also fix latent bug in mjData serialization.

PiperOrigin-RevId: 799505349
Change-Id: I299e7cc8133fa2ec0b339a7ff3d02543e06778b1
2025-08-26 04:27:24 -07:00
Sam Haves 4bad134ba2 Add proper handling of MJCF asset/mesh/texturedir compiler attributes to USD plugin.
This allows the MJCF SdfFileFormat plugin to load MJCF files that specify assetdir, meshdir, or texturedir attributes. This is specifically important for resolver implementations that fetch assets into a local cache.

PiperOrigin-RevId: 796509754
Change-Id: Ib2b0c9cf9d6a3351ceea49d90c882edf94d0b880
2025-08-18 11:38:32 -07:00
Sam Haves e74cee652f Add README to mjcPhysics.
PiperOrigin-RevId: 791183563
Change-Id: I4383dcab12128a745e435ac7f2cea52cccc4ce60
2025-08-05 06:18:37 -07:00
Sam Haves 4c288c19ac Remove physics schema authoring toggle from MJCF SdfFileFormat plugin.
PiperOrigin-RevId: 789321573
Change-Id: Ib29bb426f8598a58f7b34c048b154fa8ada589ef
2025-07-31 07:07:18 -07:00
Sam Haves b5368a3385 Add displayColor authoring to site geometry when converting MJCF to USD.
PiperOrigin-RevId: 789311878
Change-Id: I70027cd5d8d02f4ee26043f3b9fb03311e38984b
2025-07-31 06:28:42 -07:00
Sam Haves a04e0385e4 Add USD content type support in MJCF.
PiperOrigin-RevId: 788075561
Change-Id: If37cc254cab0411454de7663e0b3ff9f2b263281
2025-07-28 10:53:49 -07:00
Sam Haves 541c56b46f Create mjcPhysics ImageableAPI for visual, non physical visual entities.
PiperOrigin-RevId: 786366034
Change-Id: Ifb72d2daf8f5963bb7007dda1685da94b456ff41
2025-07-23 11:48:17 -07:00
Sam Haves 7da32d186f Add basic visual material parsing support to USD interop.
For this first iteration we only support simple UsdPreviewSurface spec node graphs.

PiperOrigin-RevId: 786309455
Change-Id: I2e5501a65b22aca6da570bc94394514c67bd100a
2025-07-23 09:21:56 -07:00
Sam Haves 8383bd439c Add support for parsing 'st' primvar from USD.
PiperOrigin-RevId: 786277487
Change-Id: Id99e6bf6a656b623950c363597da3930ee4c00e3
2025-07-23 07:47:50 -07:00
Sam Haves c2820941aa Convert UsdPhysicsRevoluteJoint from degres to radians if compiler option is set.
PiperOrigin-RevId: 784574716
Change-Id: I58f65816edb782fcb41bbc721f7bed5a27741639
2025-07-18 07:18:17 -07:00
Sam Haves 46b713ef2d Remove pedantic designated initializers in USD parsing.
PiperOrigin-RevId: 784544836
Change-Id: Ie36136b2a0b8105ccb4a4679883120638ec80699
2025-07-18 05:10:12 -07:00
Sam Haves e92ce30732 Account for scale authored on UsdMesh prims.
PiperOrigin-RevId: 784231423
Change-Id: I82b363c6c40940982ebeb0b1949e0e1e8f92199d
2025-07-17 10:29:31 -07:00
Sam Haves c597434fc9 When UsdCollisionAPI is applied but collisionEnabled is false, treat it as a visual gprim.
PiperOrigin-RevId: 784219782
Change-Id: If87e1cd7e1cc10b27a3d432585466e3aece71d26
2025-07-17 09:59:37 -07:00
Sam Haves f5df466ee5 Add support for visual gprims to USD parsing.
PiperOrigin-RevId: 784197335
Change-Id: I8eb155b7942209f372487f8268ad76310cf510ac
2025-07-17 08:51:50 -07:00
Sam Haves 2e13c64308 Simplify parsing from USD stage to kinematic tree for mjSpec population.
Summary of changes:
 - Move stage parsing from usd_to_mjspec to kinematic_tree
 - A Node now has lists of paths for prims that we support parsing.
 - When parsing the stage, we create a list of all the Nodes that we will place in our tree.
 - Removed the need for expensive SdfPath maps and sorting of bodies in favor of indexed integer arrays.
 - Simplifies usd_to_mjspec parsing as we can process each node and it's owned prims one at a time.

PiperOrigin-RevId: 784187799
Change-Id: I4907cfa1137014af21c45b10fa29ac53a49b6dac
2025-07-17 08:20:10 -07:00
Sam Haves 3cc8d7f58a Fix typo in mjcPhysics MjcMaterialAPI
PiperOrigin-RevId: 783750052
Change-Id: Ib829ae7ead7a33572e94ee0fe221da778b623f10
2025-07-16 07:31:09 -07:00
Sam Haves 6144a508b5 In Mujoco USD interop, only consider dynamic friction when writing to and parsing from USD.
PiperOrigin-RevId: 783741987
Change-Id: I23c47a6e95c160c5c7d5c513e268c79e4236e2e4
2025-07-16 07:00:18 -07:00
Sam Haves b99d9e8f12 Fix inherit range pulling from act early attribute when parsing USD to MjSpec.
PiperOrigin-RevId: 783735573
Change-Id: I988f16cd16e47caa84a30009c36a932ec3672429
2025-07-16 06:35:10 -07:00
Sam Haves ac0701d582 Add mujoco compiler settings to MjcSceneAPI in mjcPhysics.
PiperOrigin-RevId: 783729333
Change-Id: Ic1c3e4fb47a901de4eebdc2e987d276f4202d9ed
2025-07-16 06:09:36 -07:00
Sam Haves cdf5bcb693 Add inheritrange attribute to mjcPhysics MjcActuator
PiperOrigin-RevId: 783363012
Change-Id: I7d0476aae70c3acc3ed4808a8741b7eb12948dba
2025-07-15 09:30:16 -07:00