Instructions to use k-valentin/unitree-g1-mujoco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use k-valentin/unitree-g1-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
- Notebooks
- Google Colab
- Kaggle
Import lerobot/unitree-g1-mujoco@68459ed6 + 23dof (rev_1_0) body variant, defaults BODY=23dof END_EFFECTOR=dummy
257dded verified Download sim/simulator_factory.py from k-valentin/unitree-g1-mujoco: direct link, hf CLI and curl.
- Browser
- Download file 2.07 kB
-
https://huggingface.co/k-valentin/unitree-g1-mujoco/resolve/main/sim/simulator_factory.py
- Command line
-
hf download hf://k-valentin/unitree-g1-mujoco/sim/simulator_factory.py
-
curl -L -o simulator_factory.py https://huggingface.co/k-valentin/unitree-g1-mujoco/resolve/main/sim/simulator_factory.py
2.07 kB
| import time | |
| from typing import Any, Dict | |
| from unitree_sdk2py.core.channel import ChannelFactoryInitialize | |
| from .base_sim import BaseSimulator | |
| def init_channel(config: Dict[str, Any]) -> None: | |
| """ | |
| Initialize the communication channel for simulator/robot communication. | |
| Args: | |
| config: Configuration dictionary containing DOMAIN_ID and optionally INTERFACE | |
| """ | |
| if config.get("INTERFACE", None): | |
| ChannelFactoryInitialize(config["DOMAIN_ID"], config["INTERFACE"]) | |
| else: | |
| ChannelFactoryInitialize(config["DOMAIN_ID"]) | |
| class SimulatorFactory: | |
| """Factory class for creating different types of simulators.""" | |
| def create_simulator(config: Dict[str, Any], env_name: str = "default", **kwargs): | |
| """ | |
| Create a simulator based on the configuration. | |
| Args: | |
| config: Configuration dictionary containing SIMULATOR type | |
| env_name: Environment name | |
| **kwargs: Additional keyword arguments for specific simulators | |
| """ | |
| simulator_type = config.get("SIMULATOR", "mujoco") | |
| if simulator_type == "mujoco": | |
| return SimulatorFactory._create_mujoco_simulator(config, env_name, **kwargs) | |
| else: | |
| print( | |
| f"Warning: Invalid simulator type: {simulator_type}. " | |
| "If you are using run_sim_loop, please ignore this warning." | |
| ) | |
| return None | |
| def _create_mujoco_simulator(config: Dict[str, Any], env_name: str = "default", **kwargs): | |
| """Create a MuJoCo simulator instance.""" | |
| camera_configs = kwargs.pop("camera_configs", {}) | |
| if len(camera_configs) > 0: | |
| print(f"Debug: SimulatorFactory received {len(camera_configs)} camera config(s)") | |
| env_kwargs = dict( | |
| onscreen=kwargs.pop("onscreen", True), | |
| offscreen=kwargs.pop("offscreen", False), | |
| camera_configs=camera_configs, | |
| ) | |
| return BaseSimulator(config=config, env_name=env_name, **env_kwargs) | |