A LiDAR sensor designed for MuJoCo
Project description
MuJoCo-LiDAR: High-Performance LiDAR Simulation
High-performance LiDAR simulation for MuJoCo with CPU, Taichi, JAX, and Warp backends.
中文文档 | Installation | Usage Guide | Development | Contributing
Features
- 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
- Warp: NVIDIA Warp ray casting, supports dynamic mesh scenes and batched scenes
- 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
Quick Start
Installation
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]"
# With Warp backend (GPU + dynamic mesh + batch)
uv add "mujoco-lidar[warp]"
From Source:
git clone https://github.com/TATP-233/MuJoCo-LiDAR.git
cd MuJoCo-LiDAR
uv sync --extra dev --extra examples
# Optional GPU backends
uv sync --extra dev --extra examples --extra taichi
uv sync --extra dev --extra examples --extra warp
uv sync --extra dev --extra examples --extra taichi --extra jax --extra warp
Run a non-ROS example after installing from source:
# Native MuJoCo viewer, CPU backend
uv run --extra dev --extra examples python examples/example_native.py --backend cpu
# Same example with the Warp backend, if installed
uv run --extra dev --extra examples --extra warp python examples/example_native.py --backend warp
# Unitree Go2, no ROS required
uv run --extra dev --extra examples --extra warp python examples/unitree_go2.py --backend warp --stand
See Installation Guide for details.
Basic Usage
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", "warp"
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.
Performance
| Backend | Rays/sec | Hardware | Batch Support |
|---|---|---|---|
| CPU | ~9M | Native | No |
| Taichi | ~62M | GPU | Yes |
| JAX | ~231M | GPU | Yes |
| Warp | ~100M | GPU | Yes |
Run benchmarks: make benchmark
Documentation
- 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
- examples/example_native.py - MuJoCo viewer; supports
--backend cpu|taichi|jax|warp - examples/example_mjcf.py - MJCF scene with Matplotlib point-cloud view
- examples/example_string.py - Self-contained XML string scene
- examples/unitree_go2.py - Unitree Go2 without ROS; supports
--backend - examples/unitree_g1.py - Unitree G1 without ROS; supports
--backend
Development
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 tests
See CONTRIBUTING.md for contribution guidelines.
License
MIT License - see LICENSE for details.
Citation
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}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mujoco_lidar-0.3.1.tar.gz.
File metadata
- Download URL: mujoco_lidar-0.3.1.tar.gz
- Upload date:
- Size: 39.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2149377ca6cba8b021aa954eca25084cc7738f2b74695fdd049ac93749e03435
|
|
| MD5 |
121cba2da3dc63a8ada3120c404b811c
|
|
| BLAKE2b-256 |
ae5e96eed9cfc9e70810394774afff679d5d6da17cddfcb5e6fc0642ac3896e0
|
Provenance
The following attestation bundles were made for mujoco_lidar-0.3.1.tar.gz:
Publisher:
publish.yml on discoverse-dev/MuJoCo-LiDAR
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mujoco_lidar-0.3.1.tar.gz -
Subject digest:
2149377ca6cba8b021aa954eca25084cc7738f2b74695fdd049ac93749e03435 - Sigstore transparency entry: 1884721013
- Sigstore integration time:
-
Permalink:
discoverse-dev/MuJoCo-LiDAR@22d7edaa5b0416ca9665f6a2a9a7cb8b3cf2bff5 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/discoverse-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@22d7edaa5b0416ca9665f6a2a9a7cb8b3cf2bff5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mujoco_lidar-0.3.1-py3-none-any.whl.
File metadata
- Download URL: mujoco_lidar-0.3.1-py3-none-any.whl
- Upload date:
- Size: 39.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35df777985671a8a2c105d231f85633191f55e6164c84886b13b06c2e2ec7498
|
|
| MD5 |
44d25929431daee36859be83f6ba4ee4
|
|
| BLAKE2b-256 |
b16d7cc016f0900b41a7b1dd19f23e4ca64a24cdf90ebe3918d4397283ec37de
|
Provenance
The following attestation bundles were made for mujoco_lidar-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on discoverse-dev/MuJoCo-LiDAR
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mujoco_lidar-0.3.1-py3-none-any.whl -
Subject digest:
35df777985671a8a2c105d231f85633191f55e6164c84886b13b06c2e2ec7498 - Sigstore transparency entry: 1884721065
- Sigstore integration time:
-
Permalink:
discoverse-dev/MuJoCo-LiDAR@22d7edaa5b0416ca9665f6a2a9a7cb8b3cf2bff5 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/discoverse-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@22d7edaa5b0416ca9665f6a2a9a7cb8b3cf2bff5 -
Trigger Event:
push
-
Statement type: