4 releases

0.0.6 May 28, 2023
0.0.4 Dec 23, 2022
0.0.3 Dec 9, 2022
0.0.2 Oct 18, 2022

#3 in #mujoco

Download history 5/week @ 2024-09-18 6/week @ 2024-09-25

57 downloads per month
Used in bevy_mujoco

MIT license

44KB
1K SLoC

mujoco-rust

MuJoCo bindings for Rust

Installation requirements

These bindings require that MuJoCo be installed before building. The build system assumes that MuJoCo is installed into ~/.local/mujoco on UNIX-based systems and C:\Program Files\MuJoCo on Windows, but any installation directory can be used, as long as either the environment variable MUJOCO_DIR or MUJOCO_PREFIX is set to the root of the installation.

Usage

These wrappers use mujoco-rs-sys to provide rust bindings to the MuJoCo C API. The mujoco-rs-sys crate is not intended to be used directly, but instead is used by mujoco-rust to provide a more idiomatic rust interface to the MuJoCo API.

Example Usage

Cargo.toml

[dependencies]
mujoco-rust = { version = "0.0.6" }

main.rs

let model = mujoco_rust::Model::from_xml("simple.xml".to_string()).unwrap();
let simulation = MuJoCoSimulation::new(model);

lib.rs:

Provides safe bindings to MuJoCo, a physics simulator commonly used for robotics and machine learning.

Dependencies

~5–16MB
~183K SLoC