Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# Uses GPU enabled torch
# FROM public.ecr.aws/artefacts/go2:mujoco
# Uses CPU only torch
FROM public.ecr.aws/artefacts/go2:mujoco-cputorch
FROM nvidia/cuda:12.8.1-base-ubuntu22.04

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics
ENV MUJOCO_GL=egl
SHELL ["/bin/bash", "-c"]

RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 libglfw3 libgles2 libegl1 libglib2.0-0 \
python3-pip python3-dev ffmpeg git curl cmake build-essential \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /ws
COPY pyproject.toml uv.lock .python-version ./
# Use cpu-torch (for smaller image size)
RUN uv lock --index pytorch=https://download.pytorch.org/whl/cpu
# TODO: Should we move optional dependencies (like rerun-sdk) to extras to decrease the image size?
RUN uv sync

COPY artefacts.yaml go2_wtw_demo.py utils.py ./
COPY tests/ tests/
COPY resources/ resources/

CMD artefacts run $ARTEFACTS_JOB_NAME
CMD uv run artefacts run $ARTEFACTS_JOB_NAME
60 changes: 0 additions & 60 deletions Dockerfile.base

This file was deleted.

57 changes: 19 additions & 38 deletions README.md
Comment thread
tomonorman marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,61 +1,42 @@
# Go2 MuJoCo Walk Demo (Artefacts)

Unitree Go2 walking demo using MuJoCo and the Walk-These-Ways pretrained policy.
Unitree Go2 walking demo using MuJoCo.
The demo runs on ubuntu, but also MacOS natively without vms or containerization.

A flat scene is added to the `unitree_mujoco` package (see copy stage) to provide a simple demo for the [Go2](https://www.unitree.com/go2) to move.

With thanks to [Teddy Liao](https://github.com/Teddy-Liao) for the pretrained policy in the [walk-these-ways-go2](https://github.com/Teddy-Liao/walk-these-ways-go2) repository.

## Setup

### Prerequisites

You will need cyclonedds installed if you do not have it already. We suggest to install outside of this project.
This project uses `uv` for Python environment management. For installation instructions, see https://docs.astral.sh/uv/getting-started/installation/


## Initialize the virtual environment
```bash
cd ~
git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
cd cyclonedds && mkdir build install && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
cmake --build . --target install
uv sync
source .venv/bin/activate
```

### Project Setup
## Run

#### Run follow-on-rails demo with procedurally generated railroad:
```bash
cd ~/go2-mujoco-artefacts
# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Clone required repos
mkdir -p src
git clone --depth=1 -b high-level-direct https://github.com/art-e-fact/unitree_mujoco.git src/unitree_mujoco
git clone --depth=1 https://github.com/unitreerobotics/unitree_sdk2_python.git src/unitree_sdk2_python
# Install the sdk
cd src/unitree_sdk2_python
export CYCLONEDDS_HOME=~/cyclonedds/install
pip install -e .

# Back to root of repository
cd ../..
# Download WTW policy checkpoints (3 files only, no full repo clone)
bash scripts/fetch_wtw_checkpoints.sh

# Install dependencies
pip install -r requirements.txt
python go2_rails_demo.py --rerun --heightmap-nav --seed 123
```
## Run (Linux)
The robot should walk on the rails following the target object.

_Note: run `python go2_rails_demo.py --help` for more options._

#### Run the robot with WTW policy in a test environment:
```bash
source venv/bin/activate # if not already
python go2_wtw_demo.py
```
## Run (MacOS)
```bash
source venv/bin/activate # if not already
mjpython go2_wtw_demo.py
```
The robot will walk forward and turn left in a loop.

_Note: run `python go2_wtw_demo.py --help` for more options._
Comment thread
tomonorman marked this conversation as resolved.



### Run test with artefacts

Expand Down
Loading