| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| FROM python:3.12-slim |
|
|
| ENV DEBIAN_FRONTEND=noninteractive \ |
| CYCLONEDDS_HOME=/opt/cyclonedds \ |
| LD_LIBRARY_PATH=/opt/cyclonedds/lib \ |
| MUJOCO_GL=osmesa \ |
| SDL_VIDEODRIVER=dummy \ |
| SDL_AUDIODRIVER=dummy \ |
| G1_SIM_DIR=/opt/g1-sim \ |
| G1_PUBLISH_IMAGES=0 \ |
| G1_CAMERA_PORT=5555 \ |
| G1_ENABLE_MESHCAT=1 \ |
| G1_MESHCAT_DEBUG=0 \ |
| G1_ENABLE_VIEW=1 \ |
| G1_MESHCAT_WEB_PORT=7000 \ |
| G1_HEALTH_PORT=7860 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential git curl cmake pkg-config ca-certificates \ |
| libgl1 libglx-mesa0 libosmesa6 libosmesa6-dev \ |
| libx11-6 libxrandr2 libxinerama1 libxcursor1 libxi6 libxext6 libxfixes3 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN git clone --depth 1 -b releases/0.10.x \ |
| https://github.com/eclipse-cyclonedds/cyclonedds /tmp/cdds \ |
| && cmake -S /tmp/cdds -B /tmp/cdds/build \ |
| -DCMAKE_INSTALL_PREFIX=${CYCLONEDDS_HOME} -DBUILD_IDLC=ON -DBUILD_DDSPERF=OFF \ |
| && cmake --build /tmp/cdds/build --target install -j"$(nproc)" \ |
| && rm -rf /tmp/cdds |
|
|
| |
| RUN pip install --no-cache-dir \ |
| "mujoco>=3.0.0" "numpy>=1.24.0" scipy pyyaml loguru pygame termcolor glfw gymnasium \ |
| opencv-python-headless pyzmq "msgpack>=1.0.0" "msgpack-numpy>=0.4.8" matplotlib meshcat \ |
| huggingface_hub aiohttp \ |
| "cyclonedds==0.10.2" |
|
|
| |
| |
| RUN git clone --depth 1 https://github.com/unitreerobotics/unitree_sdk2_python.git /tmp/usdk \ |
| && pip install --no-cache-dir /tmp/usdk \ |
| && LIBDIR="$(python -c 'import os, unitree_sdk2py; print(os.path.join(os.path.dirname(unitree_sdk2py.__file__), "utils", "lib"))')" \ |
| && mkdir -p "${LIBDIR}" \ |
| && cp -v /tmp/usdk/unitree_sdk2py/utils/lib/* "${LIBDIR}/" \ |
| && rm -rf /tmp/usdk |
|
|
| |
| ARG G1_ENV_REV=a38dc8617f0fca51b38e9354dc58ee35ad850fb5 |
| RUN python -c "import os, shutil; from huggingface_hub import snapshot_download; \ |
| d = snapshot_download('lerobot/unitree-g1-mujoco', revision='${G1_ENV_REV}'); \ |
| shutil.copytree(d, os.environ['G1_SIM_DIR'], symlinks=False, dirs_exist_ok=True)" \ |
| && python -c "import os, yaml; p = os.path.join(os.environ['G1_SIM_DIR'], 'config.yaml'); \ |
| c = yaml.safe_load(open(p)); c['ENABLE_ONSCREEN'] = False; yaml.safe_dump(c, open(p, 'w'))" |
|
|
| |
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| wget procps git-lfs \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| COPY g1_sim_entry.py ${G1_SIM_DIR}/g1_sim_entry.py |
| COPY g1_sim_bridge.py ${G1_SIM_DIR}/g1_sim_bridge.py |
| COPY g1_sim_meshcat.py ${G1_SIM_DIR}/g1_sim_meshcat.py |
| COPY g1_sim_ctl.py ${G1_SIM_DIR}/g1_sim_ctl.py |
| COPY g1_health.py ${G1_SIM_DIR}/g1_health.py |
| COPY g1_view_server.py ${G1_SIM_DIR}/g1_view_server.py |
| COPY g1_sim_start.sh ${G1_SIM_DIR}/g1_sim_start.sh |
| RUN chmod +x ${G1_SIM_DIR}/g1_sim_start.sh |
|
|
| EXPOSE 7860 7000 6000 6001 6002 6003 |
| WORKDIR ${G1_SIM_DIR} |
| |
| |
| CMD ["bash", "g1_sim_start.sh"] |
|
|