Instructions to use lerobot/asimov-mujoco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use lerobot/asimov-mujoco with LeRobot:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Asimov
How to use lerobot/asimov-mujoco with Asimov:
# Run the policy in a browser simulation of the Asimov 1 humanoid (no GPU needed) git clone https://github.com/menloresearch/humanoid-policy-viewer cd humanoid-policy-viewer npm install npm run hf lerobot/asimov-mujoco
- Notebooks
- Google Colab
- Kaggle
Download run_sim.py from lerobot/asimov-mujoco: direct link, hf CLI and curl.
- Browser
- Download file 1.95 kB
-
https://huggingface.co/lerobot/asimov-mujoco/resolve/main/run_sim.py
- Command line
-
hf download hf://lerobot/asimov-mujoco/run_sim.py
-
curl -L -o run_sim.py https://huggingface.co/lerobot/asimov-mujoco/resolve/main/run_sim.py
1.95 kB
| #!/usr/bin/env python3 | |
| import sys | |
| from pathlib import Path | |
| import time | |
| # Add sim module to path | |
| sys.path.insert(0, str(Path(__file__).parent)) | |
| import yaml | |
| from sim.simulator_factory import SimulatorFactory | |
| def main(n_envs=1, use_async_envs: bool = False, | |
| publish_images=True, camera_port=5555, cameras=None, **kwargs): | |
| # Load config | |
| config_path = Path(__file__).parent / "config.yaml" | |
| with open(config_path) as f: | |
| config = yaml.safe_load(f) | |
| # Override config with default values | |
| enable_offscreen = publish_images or config.get("ENABLE_OFFSCREEN", False) | |
| # Configure cameras if requested | |
| camera_configs = {} | |
| if enable_offscreen: | |
| camera_list = config["CAMERAS"] if cameras is None else cameras | |
| for cam_name in camera_list: | |
| camera_configs[cam_name] = {"height": 480, "width": 640} | |
| print(f"📷 Cameras: {', '.join(camera_list)} → ZMQ port {camera_port}") | |
| print("="*60) | |
| # Create simulator | |
| sim = SimulatorFactory.create_simulator( | |
| config=config, | |
| env_name="default", | |
| onscreen=kwargs.get("onscreen", config.get("ENABLE_ONSCREEN", True)), | |
| offscreen=enable_offscreen, | |
| camera_configs=camera_configs, | |
| ) | |
| # Start simulator | |
| print("\nSimulator running. Press Ctrl+C to exit.") | |
| if enable_offscreen and publish_images: | |
| print(f"Camera images publishing on tcp://localhost:{camera_port}") | |
| try: | |
| if publish_images: | |
| sim.start_image_publish_subprocess( | |
| start_method="spawn", | |
| camera_port=camera_port, | |
| ) | |
| time.sleep(1) | |
| sim.start() | |
| except KeyboardInterrupt: | |
| print("+++++Simulator interrupted by user.") | |
| except Exception as e: | |
| print(f"++++error in simulator: {e} ++++") | |
| finally: | |
| print("++++closing simulator ++++") | |
| sim.close() | |
| if __name__ == "__main__": | |
| main() | |