Changelog¶
Versioning¶
This project uses semantic versioning. This means that any incompatible changes increase the major version (Y.x.x). This also includes breaking changes that MuJoCo itself introduced, thus even an update of MuJoCo alone can increase the major version.
2.3.5 (MuJoCo 3.3.7)¶
Fixed #161, where actuator views could crash due to a non-muscle actuator appearing after the muscle actuator.
Internal: Syncing user geoms is now slightly faster when no geoms are added, due to an early exit.
2.3.4 (MuJoCo 3.3.7)¶
3D viewer bug fixes and usability improvements:
Keyboard events are now ignored whenever an egui input widget has focus.
Fixed a logic error where pressing an unhandled mouse button would return from the event-processing loop and drop subsequent events; the handler now continues.
Combination of Ctrl+C will now not toggle camera visualization. This combination is reserved for copying.
2.3.3 (MuJoCo 3.3.7)¶
2.3.2 (MuJoCo 3.3.7)¶
Small performance improvement by removing mutex contention during MuJoCo’s scene render.
2.3.1 (MuJoCo 3.3.7)¶
Bug fixes:
Add a NULL pointer check to MjData. When allocation fails, the code will now panic instead of accepting a NULL pointer.
Fixed #139. MjrContext::read_pixels no longer allows buffers that are smaller than requested in the viewport.
Fixed potential (Rust) viewer crashes when the display is disconnected or reconfigured by ignoring some OpenGL errors. In case of an error at specific places, the errors will be ignored and viewer processing will be skipped.
2.3.0 (MuJoCo 3.3.7)¶
Changes to 3D viewer:
Added MjViewer::add_ui_callback_detached for custom UI widgets that do not require the simulation state (i.e., the passive MjData instance).
Added MjViewer::with_ui_egui_ctx, for gaining scoped access to the internal egui’s context. This can be used for additional, one-time, initialization (e.g., installing image loaders).
Replaced code that would panic on poisoned mutexes with code that automatically unpoisons the mutex — nothing fundamentally bad can happen except for a potential glitch in physics, which is still better than requiring users to wrap their code in catch_unwind calls.
Performance optimizations in the viewer UI.
-
When instantiating a model or a spec, a version check will be made between MuJoCo’s shared library and the FFI bindings to prevent accidental use of wrong MuJoCo version. The code will panic on mismatch.
2.2.2 (MuJoCo 3.3.7)¶
Bug fixes:
2.2.1 (MuJoCo 3.3.7)¶
Bug fixes:
Fixed #119 where the borrow tracker tracked the wrong lifetime.
Reset more of OpenGL state after drawing the UI with egui (drawing figures doesn’t work without this).
2.2.0 (MuJoCo 3.3.7)¶
Made 3D renderer use EGL backend by default on Linux for true offscreen rendering (pbuffer).
New feature added for compatibility purposes:
renderer-winit-fallback. The feature is enabled by default.
Changes to 3D viewer:
Added MjViewer::add_ui_callback for custom UI widgets. This allows users to create custom windows, panels, and other UI elements using egui. See Custom UI widgets for more information.
Info menu (F2) displaying smoothed FPS, simulation time, and used memory.
Realtime warning (F4) for showing the realtime factor [%] when the simulation’s sync time deviates at least 2 % from the model’s configured timestep.
Separate syncing and rendering logic:
Added MjViewer::sync_data:
Deprecates MjViewer::sync, which performed both synchronization and rendering.
Rendering must now be done through MjViewer::render, which must be called by user code.
Added ViewerSharedState:
Allows synchronization of the viewer and the simulation state in separate threads. Note that the viewer must run in the main thread.
Call MjViewer::state to obtain it.
New methods:
New examples:
Deprecated:
MjViewer::user_scene and MjViewer::user_scene_mut. They are replaced with ViewerSharedState::user_scene and ViewerSharedState::user_scene_mut.
2.1.0 / 2.1.1 (MuJoCo 3.3.7)¶
Option to automatically pull MuJoCo.
pkg-config support for Linux and MacOS. Note that this is not officially supported by MuJoCo.
Changes to MjViewer:
Added an optional (enabled by default) user interface, made with egui.
New Cargo features:
auto-download-mujoco: will automatically download MuJoCo (Windows and Linux).
2.0.1 (MuJoCo 3.3.7)¶
Fix the
rendererfeature not enabling all the needed crates.
2.0.0 (MuJoCo 3.3.7)¶
Breaking changes:
Updated the MuJoCo version to 3.3.7.
-
Items (MjsJoint, MjsGeom, etc.) are no longer wrapped and are instead just aliased types. Their attributes have been made private to users, so that tools like
rust-analyzerdon’t suggest both the getter name and the attribute name at once. As a result of this change, methods now return true references instead of the wrapper types.Added immutable iterators.
Changed regular named-access methods to be immutable and added corresponding
_mut()methods for mutable access.Replaced
plugin_wrappermethods with a normal getter method (pluginandplugin_mut).
3D viewer and 3D renderer:
Changed the backend windowing library to Winit (+ Glutin). This is a potentially breaking change because of possible direct GLFW uses in the user code, which will probably still work as expected, but we can’t be sure as we did not test GLFW and Winit being used at the same time. Change to Winit also means we don’t need any C dependencies, unless the C++ viewer wrapper is needed, which also contains breaking changes. The latter is described in the next bullet.
Added and removed variants in mujoco_rs::viewer::MjViewerError and mujoco_rs::renderer::RendererError.
Wrapper of MuJoCo’s C++ 3D viewer:
Since MuJoCo’s build systems downloads GLFW sources anyway, we decided to remove the GLFW requirement from the Rust level and instead made it so that the user needs to compile the GLFW code during the MuJoCo’s viewer (simulate) compilation. No change is needed in the user Rust code, users just need to build MuJoCo a bit differently:
cmake --build build --parallel --target glfw libmujoco_simulate --config=Release.The above command, besides the added
glfwpart, also contains thelibmujoco_simulatepart in place of the previouslylibsimulatepart. This change is a consequence of MuJoCo upgrade to version 3.3.7.Moved the struct definition from
mujoco_rs::viewertomujoco_rs::cpp_viewer.
Changed MjData and other types to accept a generic type for the model, constrained to
Deref<Target = MjModel>. This enables use in environments such as PyO3.MjsMesh: changed
smoothnormalandneedsdfto be treated as booleans.MjData methods:
MjModel methods:
id_to_name now accepts
i32instead ofc_int,size now returns
i32instead ofc_int,state_size now accepts
u32instead ofc_uintand returnsi32instead ofc_int,
-
mjtSameFrame_ is now
repr(u8)instead ofrepr(u32)to fix alignment issues with MuJoCo’s structs,
mujoco_rs::wrappers::fun::utility:
mju_band_diag: replaced
c_inttypes withi32,mju_eig_3: replaced
c_inttypes withi32,mju_halton: replaced
c_inttypes withi32,mju_is_bad: replaced
c_inttypes withbool,mju_mat_2_rot: replaced
c_inttypes withi32,mju_ray_geom: replaced
c_inttypes with MjtGeom,mju_round: replaced
c_inttypes withi32,mju_transform_spatial: replaced
c_inttypes withbool,
Removed modules:
mujoco_rs::wrappers::mj_interface: this was in early development, but then it became apparent that its completion and usage would violate borrow checker rules, resulting in undefined behavior.
Other changes:
Any changes to MuJoCo made in MuJoCo 3.3.6 and MuJoCo 3.3.7 (see https://mujoco.readthedocs.io/en/3.3.7/changelog.html).
Added additional getters / setters / array slice methods to:
1.5.0 (MuJoCo 3.3.5)¶
-
Added the pop_geom method for popping a single geom from the end of the scene.
1.4.2 (MuJoCo 3.3.5)¶
Bug fixes:
Fixed segmentation fault when the model specification is invalid. (#65).
1.4.1 (MuJoCo 3.3.5)¶
Bug fixes:
1.4.0 (MuJoCo 3.3.5)¶
Added extra renames of enum types from the C API.
Model editing support, which can be used to procedurally generate MjModel. It can be used for terrain generation, parameter randomization, etc.
Added module mujoco_rs::wrappers::mj_editing.
Added two examples. One on basic model editing and one on terrain generation.
-
Added additional getters and setters.
Added MjRendererBuilder for purposes of better configuration.
-
Added events for keys:
Backspace: resets the simulation,F5: toggles full screen mode,[and]: cycles cameras,Visualization toggles:
C: camera,U: actuator,J: joint,M: center of mass,H: convex hull,Z: light,T: transparent,I: inertia.
Increased the headroom for visual-only geoms, which aren’t drawn by the user, from 100 to 2000.
-
Added methods:
fix: changes the camera struct parameters to display a fixed camera.
1.3.0 (MuJoCo 3.3.5)¶
Added a module for offscreen scene rendering: mujoco_rs::renderer:
Added MjRenderer for actual offscreen rendering of the simulation state.
Deprecated MjvCamera::new and replaced it with:
Deprecated MjViewer::user_scn and MjViewer::user_scn_mut. They are replaced with MjViewer::user_scene and MjViewer::user_scene_mut.
Added new methods for obtaining public attributes:
Added extra attributes to the MjData’s joint view:
1.2.0 (MuJoCo 3.3.5)¶
Added function wrappers around some utility functions and both the derivative functions (available under mujoco_rs::wrappers::fun).
Completed the virtual file system wrapper.
Added methods MjVfs::add_from_file and MjVfs::delete_file.
Added method MjModel::from_xml_vfs.
Added a long list of additional methods to MjData and MjModel, which wrap corresponding MuJoCo functions. See the Git diff on GitHub for more information.
1.1.0 (MuJoCo 3.3.5)¶
Potentially breaking changes:
Fixed bug #18 where data races could occur under incorrect usage. The major version of MuJoCo-rs is not increased as this safety bugs should not be something to rely on.
Other bug fixes:
Fixed bug #17 where the MjGeomView and MjGeomViewMut pointed to the wrong address, which belonged to the body and not the geom.
Fixed bug #19 where a warning about the scene buffer would be printed when loading some of MuJoCo’s example scenes.
Other changes:
Added new module: mujoco_rs::wrappers::mj_primitive.
Added more attributes to the view to MjJointView and MjJointViewMut.
1.0.1 (MuJoCo 3.3.5)¶
Bug fixes:
Smaller changes inside Drop implementations to make sure there is no undefined behaviors.
1.0.0 (MuJoCo 3.3.5)¶
Breaking changes:
Made all
ffi_mut()methods require unsafe blocks.
Viewer:
Help overlay (F1)
User scene via MjViewer::user_scn and MjViewer::user_scn_mut for drawing custom visual-only geoms.
Mouse perturbation of objects:
Rotate via Control
Translate via Control + Alt
0.4.3 (MuJoCo 3.3.5)¶
Build system:
Removed unnecessary header files, reducing crate’s file size.
0.4.2 (MuJoCo 3.3.5)¶
Build system:
Improved clarity of environmental variables:
MUJOCO_DYNAMIC_LINK_LIB->MUJOCO_DYNAMIC_LINK_DIRMUJOCO_STATIC_LINK_LIB->MUJOCO_STATIC_LINK_DIR
Added some internal cargo features .
0.4.1 (MuJoCo 3.3.5)¶
Fix event handling.
0.4.0 (MuJoCo 3.3.5)¶
Change the package name to mujoco-rs.
0.3.0 (MuJoCo 3.3.5)¶
Initial public release (previously private under a different project).