Commit Graph

52 Commits

Author SHA1 Message Date
Haroon Qureshi 7553541b4b Use public mj_parseXml function.
PiperOrigin-RevId: 842245812
Change-Id: I26e1f992f82050a36373ee3a3f2c97c399b4e788
2025-12-09 08:14:32 -08:00
Haroon Qureshi 97eb307ce9 First pass at mjSpec Explorer and Properties windows.
Displays the list of bodies and joints from the mjSpec and displays
values for the selected element.

Functionality is very limited and a bit non-intuitive. However, we want
to get this into our users hands to start getting feedback.

PiperOrigin-RevId: 842228895
Change-Id: I2491cd5e0acaf622110e0f6b8406919024d3607a
2025-12-09 07:28:26 -08:00
Haroon Qureshi 925c533580 Move playback speed control to the toolbar.
Initialize playback speed based on the model's global.realtime setting.

Adjust layout and tweak colours of the status and tool bars.

PiperOrigin-RevId: 842214796
Change-Id: Iff9cda74178df28a0787693242fee81e011014fc
2025-12-09 06:47:38 -08:00
Yuval Tassa cc914c9ec7 Modify studio keyboard bindings to conform to MuJoCo API.
PiperOrigin-RevId: 842197387
Change-Id: I6ee9b1f5050cb4a8c2f67253f37481c61c91fdbd
2025-12-09 05:53:14 -08:00
Haroon Qureshi 5ee8b646f7 Move Style and Layout configuration to shared GUI library.
PiperOrigin-RevId: 840246253
Change-Id: Ic4664b62e86e70fd6780cd9eb885978064c5f585
2025-12-04 08:02:16 -08:00
Haroon Qureshi 680e9a6b79 Update studio build script and instructions.
Mujoco studio now works on Windows and MacOS.

PiperOrigin-RevId: 840235447
Change-Id: I66d3430d5d994de2eb13ee08ad3051c6c7187e12
2025-12-04 07:27:37 -08:00
Haroon Qureshi c5cd276e1f Cleanup model loading flow.
Inlines the platform::LoadMujocoModel into the App class which simplifies
the logic and allows us to correctly display loading errors.

Also updates shortcuts:

Load Model (Ctrl+L) -> Open File (Ctrl+O)
Reload Model (Ctrl+R) -> Reload Model (Ctrl+L)

PiperOrigin-RevId: 840232553
Change-Id: I957d29046ae681d2aeb69310c3a2eec64d042d49
2025-12-04 07:20:02 -08:00
Sam Haves a942fd4875 Make filament segmentation shader distinct colors optional.
Previously we were computing at material update time a color for the geom based of it's
segid. This made segids unrecoverable from the resulting buffer. With this change
we allow SceneView creators to specify if they want the segmentation buffer to be purely
for visualization with distinct colors.

PiperOrigin-RevId: 840016870
Change-Id: I5920f248ace0901023e6545c7d8dd2b23f9aa397
2025-12-03 19:26:20 -08:00
Haroon Qureshi 448fc0e4d5 Report the actual GPU framerate rather than the main thread submit rate when using the filament renderer.
PiperOrigin-RevId: 838775463
Change-Id: If66644d284a4a9e0263cf31bfbd1785b18e0209b
2025-12-01 08:02:38 -08:00
Haroon Qureshi 139a5b6494 Rename toolbox to platform.
PiperOrigin-RevId: 838701951
Change-Id: I339eafd35d919710cb47bb04e9a8e29f92739513
2025-12-01 03:58:34 -08:00
Haroon Qureshi a7e62a6755 Set visual studio working directory to the bin directory.
PiperOrigin-RevId: 838681802
Change-Id: I764809d2145688c8a353907dc599a604ae944d0b
2025-12-01 02:45:53 -08:00
Haroon Qureshi ea78d83363 Use working directory if no HOME path specified.
PiperOrigin-RevId: 838680600
Change-Id: I8869da40042bb0b4edcbfe1e626c3188d0631c5e
2025-12-01 02:42:14 -08:00
Yuval Tassa 8f9250472e Improve names of Free camera control modes.
PiperOrigin-RevId: 837605181
Change-Id: I01b65706fc4f9857df4d025cd3f4587d24ee5af5
2025-11-27 13:34:09 -08:00
Yuval Tassa 2ea403575e studio: invert mouse scroll direction for camera zoom.
PiperOrigin-RevId: 837603911
Change-Id: I193a1abc0a3317aa998e7f82b9ce4b282ae7a913
2025-11-27 13:28:24 -08:00
Haroon Qureshi 5163dfa823 Move UX drawing functions into a shared library.
PiperOrigin-RevId: 837528296
Change-Id: I153a000cde424254384cf168606f32f7925ca076
2025-11-27 07:34:51 -08:00
Haroon Qureshi 23825a5bcf Implement sensor chart.
PiperOrigin-RevId: 837498928
Change-Id: I84b5911a44fe60a96b3ef34d514eb39702be7402
2025-11-27 05:38:24 -08:00
Haroon Qureshi fcad41a5b1 Implement solver stats charts.
PiperOrigin-RevId: 837045292
Change-Id: I1dfe1e10bb6d62f4d994a82c9b645b471fca5500
2025-11-26 03:25:45 -08:00
Matija Kecman 011166a13a Update the studio/README.md to summarize platform support.
PiperOrigin-RevId: 837038187
Change-Id: I00882e0a9882947af7c684e2d5521356ad1468ce
2025-11-26 02:58:05 -08:00
Haroon Qureshi eac8e60037 Merge Physics functionality into App.
The Physics class is no longer needed. This makes Studio similar to
other toolbox-based apps (like web demo and python viewer) which
manage their own mjModel and mjData instances.

PiperOrigin-RevId: 836588076
Change-Id: I3f695b49bf6a7bba1a2b639d3d75d0c996582f06
2025-11-25 03:09:21 -08:00
Haroon Qureshi 67b09f9afb Refactor simulation state history tracking into a SimHistory class.
PiperOrigin-RevId: 836578736
Change-Id: I94a852b2d2a36cdd081371f25385dbb466dd8d4b
2025-11-25 02:38:09 -08:00
Haroon Qureshi 6d9d59cb98 Move pause handling into StepControl.
Also moves perturbation handling up to the App.

Combined, this makes Physics::Update only about advancing the StepControl and resonding to its Status.

PiperOrigin-RevId: 836569506
Change-Id: I148c787f0e1c18baac3e3038ee6ad0e337eb92a8
2025-11-25 02:08:08 -08:00
Matija Kecman 7e6cb642a3 Improve formatting of percent real time selection
PiperOrigin-RevId: 835192366
Change-Id: I17057f61b96d6380dea6156dcef867b1845e6abf
2025-11-21 06:05:53 -08:00
Haroon Qureshi a2002eb3d7 Various UX improvements including:
- Add Toolbar and StatusBar.
- Reconfigure sections into Settings and Inspector groupings.
- Use docking for Settings/Inspector panels.
- Rename "Free" camera to "Tumble"; add WASD-based free camera.
- More dynamic layout of table-based elements.
- Remove "non-classic" UX mode.
- Switch to light mode by default.

PiperOrigin-RevId: 835174573
Change-Id: I1855caa79f00002e44ed2516631675727bdcb9f6
2025-11-21 04:58:20 -08:00
Haroon Qureshi a2fd5fdd4a Move profiler logic into a separate class.
PiperOrigin-RevId: 834200782
Change-Id: Ida050a5c055237c4e0a0c725a1277c9239a89538
2025-11-19 02:35:35 -08:00
Haroon Qureshi 8077a6819c Add support for OpenSans and font-awesome fonts.
PiperOrigin-RevId: 833666932
Change-Id: I5f0207c3331705b9078a1297b3e7b2a8d363ad60
2025-11-17 23:14:47 -08:00
Matija Kecman 85b6194f91 Add a README with instructions for how to build and run MuJoCo Studio externally
PiperOrigin-RevId: 833336577
Change-Id: Ib5f5ef33abe820796559a9da352360f57ea64bc8
2025-11-17 07:49:00 -08:00
Matija Kecman 8eca9926dc Fix various MuJoCo Studio build issues on Windows, MacOS and Linux
PiperOrigin-RevId: 833313973
Change-Id: I7ec181374e0bb49c32420d025044c31f6fc3c657
2025-11-17 06:35:43 -08:00
Haroon Qureshi 999344c998 Use the path of the loaded model as the base path for all further load/save operations.
PiperOrigin-RevId: 832358035
Change-Id: I44fdf8cd31d755087ebd5ec9f84f5faabe5d0702
2025-11-14 10:00:43 -08:00
Haroon Qureshi 2261733aa4 Toggle profiler window using F3.
PiperOrigin-RevId: 830869956
Change-Id: I396f89f95672096f59b909b9415be2168aac6473
2025-11-11 05:33:57 -08:00
Matija Kecman 88e75cd7e6 Remove implot from toolbox/window.cc
PiperOrigin-RevId: 830842619
Change-Id: I39d13508423ad0ba1e12349ceaccab2425d28243
2025-11-11 03:51:38 -08:00
Yuval Tassa 769f37b653 Implement sleeping in engine
PiperOrigin-RevId: 829361787
Change-Id: I6f64d8e25c4248cf32c18cd94d37ff5def78946e
2025-11-07 03:33:07 -08:00
Haroon Qureshi 01b0ea5b7d Use webgl backend in emscripten builds.
(Also only display the model name if its a file.)

PiperOrigin-RevId: 828498906
Change-Id: I7def85992f413b321c115ea63db2af057f5fd372
2025-11-05 09:17:34 -08:00
Haroon Qureshi 8b7eb097db Remove Sync and Scene functions from Renderer.
PiperOrigin-RevId: 828481721
Change-Id: Id0399139653b0ec27f0d365437e62cadefadfe6c
2025-11-05 08:33:28 -08:00
Haroon Qureshi 30a99de3b9 Remove dependencies on mjvScene for interactions.
Interactions (like moving the camera or mouse picking) no longer depend
on needing an mjvScene. Instead, everything is done relative to the
camera directly.

This duplicates some code in engine_vis_visualize which we will try to
resolve and recombine at a future time.

PiperOrigin-RevId: 828461259
Change-Id: If26329c1a7c37516f0213b18056c3e31760f60ae
2025-11-05 07:33:42 -08:00
Yuval Tassa abc02b736e Minor fixes to viewer diagnostics
- When `mjData.nefc` was 0 (solver not run at all), we were plotting the stale diagnostics from the last run; now fixed.
- In the case where islands were used, the semantic of the plotted diagnostic `sqrt_nnz` (square root of Hessian nonzeros) is changed. It used to be the sum of square roots of solver nonzeros per island, it is now the square root of the sum of all nonzeros in all islands. The semantic `sqrt(sum(nnz_i))` was found to be more consistent than `sum(sqrt(nnz_i))`, in the sense that switching islanding on/off leads to smaller changes and is more in line with the interpretation of islanding as [block-diagonalization](https://mujoco.readthedocs.io/en/3.3.7/computation/#constraint-islands).

PiperOrigin-RevId: 827624908
Change-Id: I5fc86364ead585a4752a6d44823fb75cf6c7c318
2025-11-03 13:23:05 -08:00
Haroon Qureshi 80eb511620 Remove dependency on Window, Physics, and Renderer classes.
PiperOrigin-RevId: 825137441
Change-Id: I099a518ca9618698401d0330a6ef08278168f88e
2025-10-28 11:42:17 -07:00
Haroon Qureshi 4620b9f23a Merge HandleMouseEvents and HandleKeyboardEvents back into app.cc.
PiperOrigin-RevId: 825081195
Change-Id: I36445b8c452b15ca26056a52fd1844cf77083c0a
2025-10-28 09:44:42 -07:00
Haroon Qureshi 3b79d3f14b Set flags directly on Renderer class.
This removes a dependency on mjvScene from the App class.

PiperOrigin-RevId: 824983816
Change-Id: I20dd411e6359ee411f9b0b86d4442c090ba4bd5c
2025-10-28 05:24:05 -07:00
Haroon Qureshi 7ba0d96d77 Use mjvCamera directly for generating camera string.
PiperOrigin-RevId: 824982264
Change-Id: I0d8760bb27153849c8f4dacb10aa3162f29c2f6e
2025-10-28 05:18:58 -07:00
Haroon Qureshi a16805f8ee Add CMakeLists.txt files for new (experimental) code.
This includes the filament, toolbox, and studio projects.

Adds a MUJOCO_BUILD_STUDIO option to enable building of the `studio` app (disabled by default).

Adds a MUJOCO_USE_FILAMENT to allow the studio app to use the filament rendering backend. A separate MUJOCO_USE_FILAMENT_VULKAN flag can be used to enable vulkan rendering.

PiperOrigin-RevId: 824602367
Change-Id: I26d46c16211ae2118f96c163c4194fea5b5a15a9
2025-10-27 11:26:14 -07:00
Haroon Qureshi 1fd9b47fea Prefix assets path with "assets/".
PiperOrigin-RevId: 823044312
Change-Id: I0bde4428bd1992d6d4356e107dac471fa7cdecc6
2025-10-23 08:07:33 -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
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 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
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