Hello everyone!
A few months ago I started working on an idiomatic Rust wrapper around MuJoCo, since there was no active work being done for Rust and I needed it for a different project.
MuJoCo stands for Multi-Joint dynamics with Contact. It is a general purpose physics engine that aims to facilitate research and development in robotics, biomechanics, graphics and animation, machine learning, and other areas that demand fast and accurate simulation of articulated structures interacting with their environment.
https://mujoco.org/
The library itself sticks close to the C version with the exception of encapsulating some types that aren't safe on their own. Other types are just redefinitions of the FFI type, with added methods.
To allow easier control of individual components, the MjData/MjModel also provide methods for obtaining info structs, which can be used to view into the appropriate memory locations of MjData/MjModel.
To reduce reliance on the C++ code, MuJoCo-rs also provides a Rust-native rewrite of the MuJoCo viewer. Currently it is still missing a side UI.
Additionally, for off-screen visualization, a renderer is provided, similar to the MuJoCo Python's renderer.
I encourage you to check it out and provide some feedback and requests for improvements, features, etc.
The repository: GitHub - davidhozic/mujoco-rs: MuJoCo bindings and wrappers for the Rust programming language. Includes the viewer.
Crates: crates.io: Rust Package Registry
Documentation (book): MuJoCo-rs 1.3.0 documentation
