Run example

From davidhozic/mujoco-rs · View interactive version

Run example is an AI agent skill from the GitHub repository davidhozic/mujoco-rs. Compile and run one of the example programs. Use this when asked to run an example or demo.

How to use this skill

Skill file

Running an Example

Compile and run one of the example programs.

  1. List available examples by exploring the examples/ directory. The example name is the file stem (e.g., basic.rs -> basic).
  1. Check Cargo.toml for the current MuJoCo version (look for +mj-X.Y.Z in the package version). Then find the matching mujoco-X.Y.Z/ directory at the repository root.
  1. Run the chosen example (replace X.Y.Z and <EXAMPLE_NAME>):
export MUJOCO_DYNAMIC_LINK_DIR=$(realpath mujoco-X.Y.Z/lib) && export LD_LIBRARY_PATH=$(realpath mujoco-X.Y.Z/lib/) && cargo run --example <EXAMPLE_NAME>
  1. Check the terminal output for errors.

[!NOTE]

- Most examples open a GUI window and require a display + OpenGL.

- Some examples may require specific Cargo features - read the example source file to check.

- To run in release mode add --release.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.