High-performance LiDAR simulation for MuJoCo with CPU, Taichi, and JAX backends.
中文文档 | Installation | Usage Guide | Development | Contributing
- Multi-Backend Support:
- CPU: MuJoCo native
mj_multiRay, no GPU required - Taichi: GPU parallel computing, supports Mesh and Hfield
- JAX: GPU + MJX integration, batch simulation support
- CPU: MuJoCo native
- High Performance: 1M+ rays/sec on GPU, real-time BVH construction
- Multiple LiDAR Models: Velodyne (HDL-64E, VLP-32C), Livox (mid360, avia), Ouster (OS-128), custom patterns
- ROS Integration: Ready-to-use ROS1/ROS2 examples
From PyPI:
# Basic (CPU only)
uv add mujoco-lidar
# With Taichi backend (GPU)
uv add "mujoco-lidar[taichi]"
# With JAX backend (GPU + batch)
uv add "mujoco-lidar[jax]"From Source:
git clone https://github.com/TATP-233/MuJoCo-LiDAR.git
cd MuJoCo-LiDAR
uv sync --extra dev # CPU only
uv sync --extra dev --extra taichi # with Taichi backend
uv sync --extra dev --extra taichi --extra jax # all backendsSee Installation Guide for details.
import mujoco
from mujoco_lidar import MjLidarWrapper, scan_gen
# Load model
model = mujoco.MjModel.from_xml_path("scene.xml")
data = mujoco.MjData(model)
# Create LiDAR
lidar = MjLidarWrapper(
model,
site_name="lidar_site",
backend="cpu", # or "taichi", "jax"
cutoff_dist=50.0
)
# Generate scan pattern
theta, phi = scan_gen.generate_HDL64()
# Trace rays
ranges = lidar.trace_rays(data, theta, phi)See Usage Guide for more examples.
| Backend | Rays/sec | Hardware | Batch Support |
|---|---|---|---|
| CPU | ~9M | Native | No |
| Taichi | ~62M | GPU | Yes |
| JAX | ~231M | GPU | Yes |
Run benchmarks: make benchmark
- Installation Guide - Detailed installation instructions
- Usage Guide - Examples and tutorials
- API Reference - Complete API documentation
- Development Guide - Contributing and testing
- Project Structure - Codebase organization
- examples/example_native.py - CPU backend
- examples/example_taichi.py - Taichi backend
- examples/lidar_vis_ros2.py - ROS2 integration
- examples/unitree_go2_ros2.py - Unitree Go2 robot
git clone https://github.com/TATP-233/MuJoCo-LiDAR.git
cd MuJoCo-LiDAR
uv sync --extra dev
make test # Run tests
make lint # Check code quality
make benchmark # Run performance testsSee CONTRIBUTING.md for contribution guidelines.
MIT License - see LICENSE for details.
If you use this project in your research, please cite:
@article{jia2025discoverse,
title={DISCOVERSE: Efficient Robot Simulation in Complex High-Fidelity Environments},
author={Yufei Jia and Guangyu Wang and Yuhang Dong and Junzhe Wu and Yupei Zeng and Haonan Lin and Zifan Wang and Haizhou Ge and Weibin Gu and Chuxuan Li and Ziming Wang and Yunjie Cheng and Wei Sui and Ruqi Huang and Guyue Zhou},
journal={arXiv preprint arXiv:2507.21981},
year={2025},
url={https://arxiv.org/abs/2507.21981}
}



