A LiDAR sensor designed for MuJoCo
Project description
MuJoCo-LiDAR: High-Performance LiDAR Simulation
High-performance LiDAR simulation for MuJoCo with CPU, Taichi, and JAX 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
- 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]"
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 backends
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"
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 |
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 - CPU backend
- examples/example_taichi.py - Taichi backend
- examples/lidar_vis_ros2.py - ROS2 integration
- examples/unitree_go2_ros2.py - Unitree Go2 robot
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:
@software{mujoco_lidar,
title = {MuJoCo-LiDAR: High-Performance LiDAR Simulation},
author = {Yufei Jia},
year = {2024},
url = {https://github.com/TATP-233/MuJoCo-LiDAR}
}
Project details
Release history Release notifications | RSS feed
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.0.tar.gz.
File metadata
- Download URL: mujoco_lidar-0.3.0.tar.gz
- Upload date:
- Size: 39.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1970dfcbbacc8c1f3e5371a18d19e75227174f17cc10184a94d999acc07e46
|
|
| MD5 |
a4fce0c654ca5b514edc63b86a0d0574
|
|
| BLAKE2b-256 |
b10d4dfe0cacb6fe52b9b84553d437274fb6222c5d359e3fe85a6e736ff39362
|
File details
Details for the file mujoco_lidar-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mujoco_lidar-0.3.0-py3-none-any.whl
- Upload date:
- Size: 39.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ef8f556b6cd1780d93a3ca5caa84b80298e0dbfc26adee3a32c5109ccff2104
|
|
| MD5 |
b545c4c33a735203d336b11a156e3b57
|
|
| BLAKE2b-256 |
28e1c32d6f7bf7fbc3f3c05629f8624c6eab81bfef36d1d3e8c3b23ef52da9aa
|