Saran Tunyasuvunakool
06b70832ce
Add keyboard event callback for Python passive viewer.
...
Fixes #766
Fixes #846
PiperOrigin-RevId: 549449372
Change-Id: I37d17f1162c66d0e8482d402aae22d9a16b59deb
2023-07-19 15:54:44 -07:00
Saran Tunyasuvunakool
f7847ba73e
Fix GLFW crash when Python exits while the passive viewer is running.
...
Fixes #790
PiperOrigin-RevId: 549440435
Change-Id: I808f6aaab6662225e5fe1131e0da72eca6011ba9
2023-07-19 15:20:46 -07:00
Saran Tunyasuvunakool
0ccfef7314
Add update_{hfield,mesh,texture} methods to the passive viewer.
...
Fixes #812 .
Fixes #958 .
Fixes #965 .
PiperOrigin-RevId: 548181282
Change-Id: I6eb0cd2ce52c66083e83dd08d69e0cfb4178dbba
2023-07-14 11:43:36 -07:00
Kyle Bayes
242aea93c6
Bump oldest supported MacOS to version 11.
...
PiperOrigin-RevId: 547479684
Change-Id: Idb6a432af0e7872ca087a0c571aafa72e9528818
2023-07-12 06:38:26 -07:00
Yuval Tassa
906a8e8b27
Correct shortening of camera name in simulate.cc (for UI menu item)
...
Fixes #963
PiperOrigin-RevId: 545187656
Change-Id: Ib213d693569d884915fba99f150df4fd5f53984c
2023-07-03 04:32:27 -07:00
Yuval Tassa
d40c395917
Add Visualization tab to simulate.
...
Also:
- Increased label width in mjUI tight theme spacing.
- Added `mjITEM_EDITFLOAT` for editing float values.
- Move mjUI numpad key codes to header file.
PiperOrigin-RevId: 535839953
Change-Id: Ibdc0a9a20be514caa5b487211212ed6f5b8a6ba9
2023-05-27 05:08:15 -07:00
Yuval Tassa
bb8044e5f3
Set minimum tree slider depth to 0.
...
PiperOrigin-RevId: 534003561
Change-Id: I42ccd0eab15b5a3c9852f8944c6b191f7999c113
2023-05-22 02:39:58 -07:00
Yuval Tassa
20e06ba353
Add missing braces.
...
PiperOrigin-RevId: 533419351
Change-Id: Iad54f6cb6d63c05e6a2f81526b22a914e2a23ba2
2023-05-19 04:35:12 -07:00
Nimrod Gileadi
39723891ce
Use the correct string length argument to mj_loadXML.
...
PiperOrigin-RevId: 531941053
Change-Id: Ia85b779b603a673b8e1d6f22d4bc183311204c4b
2023-05-14 14:40:36 -07:00
Saran Tunyasuvunakool
90e14ac8d0
Bump version number to 2.3.6.
...
Going forward, the version number at head will be kept one ahead of the latest released version. The rationale behind this change is so that it is clear that the source code at head is more recent.
PiperOrigin-RevId: 527687981
Change-Id: I7982ecd0b99ad70dccec6a8ffe86629754558bda
2023-04-27 14:40:32 -07:00
Saran Tunyasuvunakool
c2115a1f51
Fix a mjvSceneState leak in the passive viewer.
...
PiperOrigin-RevId: 526957248
Change-Id: I4f30faf097da64189607a4b98c6dff04fec773fa
2023-04-25 07:11:42 -07:00
Saran Tunyasuvunakool
db3b49b60f
Bump version number to 2.3.5.
...
PiperOrigin-RevId: 526918869
Change-Id: I9f19600b0c1b855ef0834e5c026b204bf1dc06c4
2023-04-25 03:52:12 -07:00
Yuval Tassa
a2a1ac9fc2
Pass mjvOption to plugin visualize callback.
...
PiperOrigin-RevId: 526047180
Change-Id: Ia63f02184f5c6a7e3b588298639fa0ab4a6da649
2023-04-21 08:44:20 -07:00
Saran Tunyasuvunakool
94779a722a
Rename Differ to IsDifferent and tidy up its implementation.
...
Startblock:
diffbase is submitted
PiperOrigin-RevId: 526024927
Change-Id: I718f3b98539f5c33a42f6254bc817a07459f694c
2023-04-21 07:14:26 -07:00
Saran Tunyasuvunakool
da17fdfcfd
Fix a macOS segfault in simulate.cc.
...
The segfault was caused by updating the UI outside the main thread.
PiperOrigin-RevId: 526019783
Change-Id: I3a211ce8a65f10716778bb3310bb568e00309a32
2023-04-21 06:46:09 -07:00
Nimrod Gileadi
d4414a0353
Initialize real_time_index to zero.
...
In the passive viewer, this value wasn't initialized.
PiperOrigin-RevId: 525760119
Change-Id: I6635270a30556600a0c51ba1d2767da226ba0440
2023-04-20 08:55:32 -07:00
Saran Tunyasuvunakool
0630b7543d
Bump version number to 2.3.4.
...
PiperOrigin-RevId: 525745444
Change-Id: I8a9994b72a0a2ba3f371bee2c2bea947ad8f4fd1
2023-04-20 07:52:46 -07:00
Saran Tunyasuvunakool
b362cb4972
Expose a handle for the Python viewer.
...
This change also requires user scripts to explicitly synchronize changes to physics state to the viewer. The Simulate class was reconfigured so that certain UI events are handled during this sync operation, outside of the render loop on the main thread. These correspond to operations that require access to the full mjModel/mjData.
To support other, more interactive operations (e.g. camera movements), a new mjvSceneState struct is introduced which captures only the portion of the physics state required for scene re-rendering. The mjvSceneState is updated from mjModel/mjData during the viewer sync operation, and is significantly cheaper than a full mj_copyModel and mj_copyData.
Fixes https://github.com/deepmind/mujoco/issues/796
PiperOrigin-RevId: 525723636
Change-Id: Id08d0210a2c067d5afe85e2bf104f276aeddd75e
2023-04-20 05:59:19 -07:00
Saran Tunyasuvunakool
5646c905cd
Rename a few functions and variables to be a bit more Googley.
...
PiperOrigin-RevId: 523963645
Change-Id: Ife7ed3f44aa83c64dfbdc3ca78ee6de2092b0d63
2023-04-13 04:24:31 -07:00
limymy
dd32843e89
Disable the propagation of MUJOCO_SIMULATE_COMPILE_OPTIONS
2023-04-12 21:50:50 +08:00
Alessio Quaglino
5f132af625
Add midphase and broadphase statistics to mjData.
...
PiperOrigin-RevId: 521387641
Change-Id: Id50f2549d119e364216491a23b107e04d9ebb5b6
2023-04-03 00:59:59 -07:00
Nimrod Gileadi
0e7e299bf6
Declare loop variables inside for loop in C++ files.
...
PiperOrigin-RevId: 518852339
Change-Id: I0174d873d89e48f11b816d337728f213c2798248
2023-03-23 07:22:36 -07:00
Nimrod Gileadi
33a2ce73d4
Update MuJoCo version to 2.3.3.
...
PiperOrigin-RevId: 517931617
Change-Id: I7c9960290f1b6e5d5f68a54df617a580f23c57e9
2023-03-20 04:36:09 -07:00
Nimrod Gileadi
c6ab23d6b4
Add a missing mjITEM_END when creating the UI for the collision tree.
...
This fixes #774 .
PiperOrigin-RevId: 517469175
Change-Id: I24a127c59f4a8dd7a5b306558425b90a80ec44f3
2023-03-17 11:51:06 -07:00
Nimrod Gileadi
08027b4e43
Only use -Wgnu-empty-initializer on Clang and not GCC.
...
Broken by ee566eb880 .
PiperOrigin-RevId: 517390165
Change-Id: Ibd8ec46647873050899cffe435e3f5c293279aae
2023-03-17 05:35:16 -07:00
Alessio Quaglino
ee566eb880
Remove empty initializers to ensure MSVC compatibility.
...
Add -Wgnu-empty-initializer to Clang builds to catch this issue in the future. Initialising arrays with empty braces is not part of the C standard and fails on MSVC. This commit should catch the issue earlier by detecting it in Clang.
PiperOrigin-RevId: 517373961
Change-Id: I518006e84151e8d5b45a7fe00ba7675dfb031ca0
2023-03-17 04:02:24 -07:00
Alessio Quaglino
70959c1a2c
Added a collision midphase on geom pairs using rotated AABBs static trees.
...
PiperOrigin-RevId: 517357695
Change-Id: I068fee714d9638be2fb6d042d5d86f8ff970635b
2023-03-17 02:37:29 -07:00
Saran Tunyasuvunakool
81ba9ec54a
Fix a rare crash when running simulate on macOS.
...
The bug was introduced in 2f0fb1e4ef . The glfwSwapBuffers call should occur on the main UI thread, not the CoreVideo DisplayLink thread.
PiperOrigin-RevId: 517172202
Change-Id: I2491f2194765019748198cd0cc61ca9263331b01
2023-03-16 11:06:25 -07:00
Yuval Tassa
8c7f6ce5a0
New implicitfast integrator and sparse RNE derivatives for implicit.
...
PiperOrigin-RevId: 516910733
Change-Id: I29a0465c0f0b1749a73e3d7e01925200d025ddd0
2023-03-15 13:17:41 -07:00
Saran Tunyasuvunakool
b6080108c3
Ignore -Wdeprecated-declarations for NSOpenGLContext.
...
PiperOrigin-RevId: 516500366
Change-Id: I39d974626e51627c767c52a7f90135963fdeb1c2
2023-03-14 05:53:35 -07:00
Saran Tunyasuvunakool
2f0fb1e4ef
Workaround for broken VSync in Simulate on macOS.
...
OpenGL VSync became broken again in macOS 13 (https://github.com/glfw/glfw/issues/2249 ). This workaround is similar to https://github.com/glfw/glfw/pull/2277 but is implemented entirely outside of GLFW.
PiperOrigin-RevId: 516320722
Change-Id: Ib8a651a942f592c74e00ad3c7b22f2dfd156be5f
2023-03-13 14:19:17 -07:00
Alessio Quaglino
3abf2ae2cd
Increase maximum number of geoms in simulate from 5000 to 20,000.
...
PiperOrigin-RevId: 516246198
Change-Id: I8a07a075b370ad0c212db8ed68b3d61389eba197
2023-03-13 10:16:12 -07:00
Yuval Tassa
2607e67f8d
Add contact labels showing which geom pairs are in contact.
...
PiperOrigin-RevId: 510422404
Change-Id: Ia73570098752e7c7175e4b5a5f2a0f8b08a6c006
2023-02-17 07:03:19 -08:00
Saran Tunyasuvunakool
5e989d18c3
Enable compiler errors for implicit switch case fallthroughs.
...
Also unify warning options across Clang and GCC and fix minor issues that was surfaced by this.
PiperOrigin-RevId: 508619655
Change-Id: I59b777bf2dfea4422485670e2427c7d3f5cf6405
2023-02-10 03:49:00 -08:00
Saran Tunyasuvunakool
95a07e85cc
Fix Windows stack overflow problem in the simulate app.
...
PiperOrigin-RevId: 507763611
Change-Id: I199910142d9165710c48b41a842ab9aef01ff5c2
2023-02-07 06:34:10 -08:00
Alessio Quaglino
dd632b7ccc
Bump MuJoCo version to 2.3.2.
...
PiperOrigin-RevId: 507720557
Change-Id: I7a5b577094ac1a7f468a84c484f62f61dc6b409f
2023-02-07 02:35:17 -08:00
Copybara-Service
36836d8e42
Merge pull request #636 from traversaro:fixextglfw
...
PiperOrigin-RevId: 507618773
Change-Id: I74362535e9840c97b7c4c3fbff29e06bcdcaf41a
2023-02-06 16:50:54 -08:00
Yuval Tassa
bc0184d67e
Increase precision of simulate sensor plot y-axis by 1 digit.
...
- Before this change, the y-axis scale had only one digit, leading to user confusion. Small changes in senor values could appear as if the values remained at the nearest integer value, while in fact the y-axis itself was changing, but this was not evident in the GUI due to the reduced precision.
- Fixes #719 .
PiperOrigin-RevId: 506841881
Change-Id: I583036bba389cef8d9ecf1c1bbcfb573ef2285e6
2023-02-03 01:48:18 -08:00
Saran Tunyasuvunakool
4b4ee27f64
Turn off reflection and shadow in simulate when a GPU is not present.
...
Note that The GLFW adapter currently assumes that a GPU is always present, so this new code path is never reached at the moment.
PiperOrigin-RevId: 504617048
Change-Id: I04a323c33d9cff73686d39e4a6676ca6a4484c98
2023-01-25 11:33:20 -08:00
Saran Tunyasuvunakool
e40775fab3
Abstract out GLFW calls from Simulate.
...
PiperOrigin-RevId: 500129478
Change-Id: I7ba998e20439575ad9a3fe1a866c3db4c36b9328
2023-01-06 02:45:56 -08:00
Kevin Zakka
a173e01f42
Prevent division by zero in Ornstein–Uhlenbeck control noise.
...
PiperOrigin-RevId: 498753494
Change-Id: Ib43e165a4da524c12fab4ea05848b084b2e7713c
2022-12-31 10:29:03 -08:00
Gianfranco Costamagna
0b33fd9eaa
sed s/atomic_bool/atomic_int/g -i simulate/simulate.h
...
Change atomic_bool to atomic_int to make sure that the compiler will try the best to
generate machine code, instead of relying on an external atomic library
2022-12-08 21:24:00 +01:00
Silvio Traversaro
ca70d8bfaf
Pass glfw3 as PACKAGE_NAME in glfw's findorfetch invocations
2022-12-07 19:25:18 +01:00
Kyle Bayes
73fb61e3e2
Bump version number to 2.3.1.
...
PiperOrigin-RevId: 493076656
Change-Id: I48c7a45b503c4a7363ea1455a4a3788262d007f7
2022-12-05 12:13:55 -08:00
Saran Tunyasuvunakool
df25d7d602
Raise an informative error when running on macOS under Rosetta 2.
...
Current users only get a cryptic "Illegal instruction" crash.
Context: https://github.com/deepmind/mujoco/issues/611
PiperOrigin-RevId: 491705647
Change-Id: I1285897a36e858300ee3d125957e90754be9a7f7
2022-11-29 12:19:06 -08:00
Saran Tunyasuvunakool
ecac5758e2
Replace NULL with nullptr.
...
PiperOrigin-RevId: 491385488
Change-Id: Iec34af99edb7ccd64834130a8cc6280a02b166c2
2022-11-28 10:44:30 -08:00
Yuval Tassa
062cb53a4a
In simulate, move "pause" label to the top left rather than the top right.
...
PiperOrigin-RevId: 491035420
Change-Id: I94ad7ca2764716f9821df6009e5c4b50675a04be
2022-11-26 05:40:52 -08: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
Saran Tunyasuvunakool
2ebc5f097b
Change simulate plugin directory name to mujoco_plugin.
...
This helps distro packagers avoid having to create a directory with the generic `plugin` name in system locations.
Context: https://github.com/deepmind/mujoco/issues/552
PiperOrigin-RevId: 489011386
Change-Id: Ie9f1748cbb4f2b9dc8c328064caaeb50c88fdec3
2022-11-16 12:40:31 -08:00
Copybara-Service
f7b256de91
Merge pull request #419 from aftersomemath:simulate-python
...
PiperOrigin-RevId: 487496285
Change-Id: I17d15bd2a3886e5ce1631f4eb78afa94830d08cc
2022-11-10 04:12:34 -08:00