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)

  • Fixed #144, where the 3D viewer caused high stack usage. This was potentially problematic on Windows, where the stack limit is 1M.

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.

  • MjModel and MjSpec:

    • 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)

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)

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 renderer feature not enabling all the needed crates.

2.0.0 (MuJoCo 3.3.7)

  • Breaking changes:

    • Updated the MuJoCo version to 3.3.7.

    • Model editing:

      • 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-analyzer don’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_wrapper methods with a normal getter method (plugin and plugin_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 glfw part, also contains the libmujoco_simulate part in place of the previously libsimulate part. This change is a consequence of MuJoCo upgrade to version 3.3.7.

      • Moved the struct definition from mujoco_rs::viewer to mujoco_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 smoothnormal and needsdf to be treated as booleans.

    • MjData methods:

      • Renamed crb to crb_comp due to crb now being a method that returns an immutable slice to the crb attribute of the ffi type,

      • energy now returns a reference to a 2-element array instead of a slice,

    • MjModel methods:

      • id_to_name now accepts i32 instead of c_int,

      • size now returns i32 instead of c_int,

      • state_size now accepts u32 instead of c_uint and returns i32 instead of c_int,

    • mujoco_rs::mujoco_c:

      • mjtSameFrame_ is now repr(u8) instead of repr(u32) to fix alignment issues with MuJoCo’s structs,

    • mujoco_rs::wrappers::fun::utility:

    • 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:

1.5.0 (MuJoCo 3.3.5)

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)

  • MjModel:

  • 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.

  • MjRenderer:

    • Added additional getters and setters.

    • Added MjRendererBuilder for purposes of better configuration.

  • MjViewer:

    • 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.

  • MjvCamera:

    • Added methods:

      • fix: changes the camera struct parameters to display a fixed camera.

1.3.0 (MuJoCo 3.3.5)

1.2.0 (MuJoCo 3.3.5)

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:

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:

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_DIR

    • MUJOCO_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).