pyCub
pyCub is a PyBullet-based simulator and educational robotics framework for the iCub humanoid robot. It provides both:
- pyCub Studio (
pycub-studio) — a cross-platform desktop application with an embedded native OpenGL 3.3 / 2.1 viewport, five integrated learning/development modes, offline bilingual handbook, course exercises, live English / Čeština switching, and standalone OS installers. icub_pybullet— a lightweight Python package for joint, velocity, and Cartesian control, tactile skin simulation, stereo eye cameras, and example controllers (without Studio GUI dependencies or handbook assets).
Quick Links: Project Website | Local HTML Handbook | Online Handbook | PDF Handbook (EN) | PDF příručka (CZ)
pyCub Studio (Standalone Desktop Application)
pyCub Studio packages the simulator into native installers and portable executables for Windows (x64), macOS (Apple Silicon arm64 & Intel x86_64), and Linux (x86_64 & arm64 .AppImage / .deb). All desktop modes render through a hardware-accelerated native OpenGL 3.3 / 2.1 viewport embedded directly inside the application window (no separate Open3D GUI window or browser needed).
Five Integrated Modes
- Kid GUI (Native Buttons) — Tactile playground with large preset actions, single-joint jog buttons, adjustable step size and speed, custom
.yamlworld loading, live ball distance/hit telemetry, and confetti celebration. - Kid GUI "Scratch" (Visual Blocks) — Offline Google Blockly visual programming with bilingual EN/CZ blocks, real-time active-block highlighting,
.pycub_blockssave/load, live Python code preview, and one-click export to Kid Programming. - Kid GUI "Programming" (High-Level Python) — Beginner-friendly Python editor powered by
icub_pybullet.kid_api(wave("right"),shoulder_up("left", 20),look_down(15),ball_touched(),ball_distance(), etc., plus Czech aliases) with clickable Command Palette, hover/signature help, starter templates, and friendly error hints. - Normal Mode (Full
pyCubIDE & Script Runner) — Multi-tab Python/YAML IDE with autocomplete, hover docs & Go to Definition (F12), external.pyscript runner (--run-script+ auto-run on save), live stdout/stderr console, dockablel_eye/r_eyeRGB & Depth camera views, coordinate axes toggle, RGB/Depth export, and one-click Course Exercises (1–5) installer + automated Exercise Tester. - Classroom Web GUI Selector (Multi-Instance Server) — Native dashboard to launch and supervise
Nindependent browser-basedkid_uisimulator instances behind a load-balanced landing page (kid_ui_landing.py), with LAN URLs, a scannable Wi-Fi QR code, live per-instance status/user counts, individual restart, and log inspection.
Installing & Running pyCub Studio via pip
Requires Python 3.10–3.12. You can install pycub-studio as a Python package so it launches from any working directory (no cloned repository needed):
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
# From PyPI (installs icub_pybullet + Studio GUI + handbook + exercises + examples):
python3 -m pip install pycub-studio
# Equivalently: python3 -m pip install "icub_pybullet[studio]"
# Or from a local repository clone:
python3 -m pip install ./icub_pybullet ./studio
# (For editable development installs: python3 -m pip install -e ./icub_pybullet -e ./studio)
# Launch Home Mode Selector
pycub-studio
# (or: python3 -m studio.main)
# Launch directly into a specific mode (home | kid_native | kid_scratch | kid_code | normal | web)
pycub-studio --mode kid_scratch --lang cs
# Open Normal Mode and immediately run an external Python script
pycub-studio --run-script /path/to/your_script.py
On Windows PowerShell, activate the virtual environment with .venv\Scripts\Activate.ps1.
User Workspace & Extra Python Packages (~/Documents/pyCub/)
On first launch, pyCub Studio creates a writable workspace in ~/Documents/pyCub/:
worlds/— Custom.yamlworld configs (automatically listed in the world selector across Modes 1–3 & 5). Custom worlds can inherit built-in configs viaparent: default.yamlorparent: with_ball.yaml.meshes/— Custom.objor.urdfscene models. Any.objwithout a pre-baked*_vhacd.objautomatically runspybullet.vhacdon first load and caches the convex decomposition in<user_cache_dir>/pycub/vhacd/.extra_packages/— Automatically added tosys.pathin simulation and script workers for third-party libraries not bundled in the installer.scripts/,projects/,exercises/,examples/,images/— Saved Python scripts, Scratch.pycub_blocksprojects, unpacked course exercises, and exported RGB/Depth screenshots.
External scripts & packages without system Python: Scripts in Mode 4 or --run-script run in an isolated worker using Studio's bundled Python runtime (pybullet, numpy, scipy, open3d, roboticstoolbox, spatialmath, matplotlib, etc.). Click Packages / Python in the top bar to install PyPI packages into extra_packages/, attach site-packages from an existing virtual environment, or select an external Python executable for Mode 4 scripts.
Building pyCub Studio (Native Installers & Bundles)
Option 1: Cross-Platform CI Build (Recommended)
Trigger .github/workflows/release-standalone.yml manually (workflow_dispatch, with optional version input) or push a v* tag to build all five targets in parallel and attach them to a GitHub Release:
- Linux
x86_64&arm64:.AppImageand.deb(pycub-studio) - Windows
x64:pyCub-Setup-<version>-Windows-x64.exeandpyCub-<version>-Portable-Windows-x64.zip - macOS
arm64(Apple Silicon) &x86_64(Intel):.dmgand.app.zip
Option 2: Local Builds
Common prerequisites:
- Python 3.10–3.12 (Python 3.13+ is not yet supported by all robotics dependencies).
- (Optional) If you edited documentation in
docs/source/,docs/source_cs/, orexercises/, rebuild the offline handbook first (python docs/build.py) sopackaging/pycub.specbundles the updateddocs/handbook/.
Linux (x86_64 and arm64)
- Install required system libraries (Debian/Ubuntu):
sudo apt-get update sudo apt-get install -y --no-install-recommends \ libegl1 libgl1 libxcb-cursor0 libnss3 libasound2 libfuse2 dpkg-dev curl # On Linux arm64, also install build tools because pybullet compiles from source: # sudo apt-get install -y build-essential python3-dev
- Run the packaging script from the repository root (automatically creates an isolated
packaging/work/build_venvunlessPYTHON_BINis provided):bash packaging/linux/build_linux.shOptional environment variables:PYCUB_VERSION=1.4.0— override artifact version string.REBUILD_VENV=1— recreatepackaging/work/build_venvfrom scratch.PYTHON_BIN=/path/to/python— use a pre-configured interpreter that already hasicub_pybullet,studio/requirements.txt, andpyinstaller>=6.10.
- Outputs in
packaging/out/:pycub-studio_<version>_<amd64|arm64>.debpyCub-<version>-Linux-<x86_64|arm64>.AppImage
Windows (x64)
- Activate a Python 3.10–3.12 environment with Studio and PyInstaller dependencies installed:
python -m pip install --upgrade pip setuptools wheel python -m pip install .\icub_pybullet python -m pip install -r .\studio\requirements.txt python -m pip install "pyinstaller>=6.10"
- (Optional) Install Inno Setup 6 (e.g.
choco install innosetup -y) to generate theSetup.exeinstaller (if omitted, the script still builds the Portable.zip). - Run the Windows build script:
$env:PYCUB_VERSION = "1.4.0" # optional powershell -ExecutionPolicy Bypass -File packaging\windows\build_windows.ps1
- Outputs in
packaging/out/:pyCub-Setup-<version>-Windows-x64.exepyCub-<version>-Portable-Windows-x64.zip
macOS (arm64 Apple Silicon & x86_64 Intel)
- Install dependencies in a Python 3.10–3.12 environment:
python3 -m pip install --upgrade pip setuptools wheel # On Intel macOS (x86_64), pin Open3D 0.19.0 (last wheel supporting Intel macOS): # python3 -m pip install "open3d==0.19.0" python3 -m pip install ./icub_pybullet python3 -m pip install -r studio/requirements.txt python3 -m pip install "pyinstaller>=6.10"
- Build
.appbundle (ad-hoc signed) and.dmg:PYCUB_VERSION=1.4.0 bash packaging/macos/build_dmg.sh
- Outputs in
packaging/out/:pyCub-<version>-macOS-<arm64|x86_64>.dmgpyCub-<version>-macOS-<arm64|x86_64>.zip
Raw PyInstaller Bundle (Any OS)
To build only the unpacked PyInstaller application directory (dist/pyCub or dist/pyCub.app) without creating OS installers:
pyinstaller --noconfirm packaging/pycub.spec
Python Package Installation (icub_pybullet & pycub-studio)
-
icub_pybulletinstalls the simulator, robot meshes/URDFs, YAML configs,kid_api, and example scripts cleanly on their own — without Qt/PySide6, Studio UI, or the offline handbook. -
pycub-studio(oricub_pybullet[studio]) depends onicub_pybulletand adds the full desktop application, Blockly assets, offline HTML/PDF handbook, and course exercises (1–5) with thepycub-studiolauncher command. -
Requires Python 3.10 to 3.12 (newer Python versions are not currently supported due to dependency compatibility).
-
Recommended: create a virtual environment first:
python3 -m venv pycub_venv source pycub_venv/bin/activate
- Install from PyPI (recommended):
python3 -m pip install icub_pybullet # simulator library only python3 -m pip install pycub-studio # or "icub_pybullet[studio]" for full Studio
- Install from source:
git clone https://github.com/rustlluk/pyCub.git cd pyCub python3 -m pip install --upgrade pip python3 -m pip install ./icub_pybullet # simulator library only python3 -m pip install ./icub_pybullet ./studio # simulator + pycub-studio command
- Docker / Gitpod:
- Native Docker (GNU/Linux): see Native Version
- VNC Docker (Windows/macOS/Linux): see VNC Version
- Gitpod: open https://app.gitpod.io/#https://github.com/rustlluk/pycub, log in with GitHub, open port
6080, and runstart-vnc-session.shin the terminal.
Examples & Core Modules
- push_the_ball_pure_joints.py — controlling the robot in joint space.
- push_the_ball_cartesian.py — controlling the robot in Cartesian space (
Pose+ IK). - skin_test.py — tactile skin contacts with balls falling onto the robot (slow down simulation or check
skin_activations). - Simulator core: pycub.py
- Beginner API: kid_api.py
- Visualization backend: visualizer.py (uses Open3D for standalone scripts, web fallback, or the embedded OpenGL viewport inside
pyCub Studio).
Documentation & Building the Handbook
Open Handbook in pyCub Studio or browse the local HTML handbook (online at pyCub Handbook; PDF: English, Čeština). The handbook covers Studio modes, Python programming across Kid/Studio/Normal modes, examples, course exercises, and the auto-generated API reference.
To rebuild the English and Czech HTML + PDF handbooks from the repository root (Python 3.10–3.12):
python3 -m pip install -r docs/requirements.txt
python3 docs/build.py # builds HTML + PDF (pass --no-pdf to skip LaTeX PDF)
The build writes docs/handbook/index.html, docs/handbook/cs/index.html, and (when latexmk + pdflatex + make are installed) docs/handbook/pycub.pdf and docs/handbook/cs/pycub.pdf. Commit the rebuilt docs/handbook/ alongside documentation changes so GitHub Pages and offline Studio installers pick them up. To preview the full Jekyll site locally, run jekyll serve inside docs/.
For additional Sphinx targets, run make -C docs help or docs\make.bat help.
FAQ & Known Issues
- Visualization errors or segmentation faults (e.g. with Open3D):
- Run
pyCub Studio(pycub-studioorpython3 -m studio.main), which uses an embedded native OpenGL 3.3 / 2.1 viewport instead of a separate Open3D GUI window. - Check your graphics drivers (Mesa / OpenGL / NVIDIA).
- Use Native Docker (Linux) or VNC Docker.
- In your
.yamlconfig, setgui.standard: Falseandgui.web: Trueto use the browser visualizer.
- Run
- Import errors (e.g.
No module named icub_pybullet):- Install from PyPI (
python3 -m pip install icub_pybulletorpycub-studio) or from source (python3 -m pip install ./icub_pybullet). - Or add the repository root directory to your
PYTHONPATH.
- Install from PyPI (
- Known bug with Open3D skin visualization:
- In standalone Open3D mode, visualization with tactile skin active can crash after ~65k steps (see Open3D#4992).
pyCub Studio's embedded OpenGL viewport is not affected.
- In standalone Open3D mode, visualization with tactile skin active can crash after ~65k steps (see Open3D#4992).
Docker
Native Version
- Native GUI inside Docker (GNU/Linux only — Ubuntu, Mint, Arch, etc.); useful for avoiding host OpenGL driver issues.
- Install docker-engine (do not install Docker Desktop on Linux) and perform the Linux post-installation steps.
- Clone the repository and pull or build the image:
git clone https://github.com/rustlluk/pyCub.git cd pyCub/Docker # Pull prebuilt image from Docker Hub: ./deploy.py -p /path/to/pyCub -c pycub -pu # Or build locally: ./deploy.py -p /path/to/pyCub -c pycub -b
- Run an existing container or open a new terminal in it:
./deploy.py -c pycub -e # start/attach ./deploy.py -c pycub -t # open another terminal
VNC Version
- Works on Windows, macOS, and Linux; displays the GUI in your browser at http://localhost:6080.
- Install docker-engine (Linux) or docker-desktop (all systems) and complete any post-install steps.
- Pull or build with
-vnc:cd /path/to/pyCub/Docker ./deploy.py -p /path/to/pyCub -c pycub -pu -vnc
- Inside the container, run
start-vnc-session.shand open http://localhost:6080.
Docker + PyCharm
- Native Version: Either launch PyCharm inside Docker, or configure an SSH interpreter in host PyCharm (
user: docker, hostlocalhostor server IP, port2222, disable automatic upload, map remote path to/home/docker/pycub_ws). - VNC / Gitpod Version: Open PyCharm directly inside the container.
Deploy Parameters
Run ./deploy.py inside Docker/:
-b/--build: Build the Docker image (default:False).-e: Run an existing container without rebuilding (default:False).-p/--path: Path to the repository folder (default:"").-pu/--pull: Pull image from Docker Hub (default:False).-c/--container: Container name (default:my_new_docker).-t/--terminal: Open a new terminal in a running container (default:False).-pv/--python-version: Python version to install (default:3.11).-pcv/--pycharm-version: PyCharm version to install (default:2023.2.3).-bi/--base-image: Base Docker image (default:ubuntu:20.04).
Run deploy.py on the machine where you run the code (over SSH if using a remote server).
Docker FAQ
- Not in
sudogroup when running the pulled image: Checkid -u. If your UID is not1000, build the image locally instead of pulling it. sudo apt install ...fails inside the container: Runsudo apt updatefirst (apt caches are cleaned in theDockerfileto save space).
Citing
When used in academic work, please cite this repository as:
@inproceedings{rustler2026pycub,
title={Learning with pyCub: A Simulation and Exercise Framework for Humanoid Robotics},
author={Lukas Rustler and Matej Hoffmann},
year={2026},
booktitle={17th International Conference on Robotics in Education (RiE 2026)},
organization={Springer}}
License
This work is licensed under a Creative Commons Attribution 4.0 International License.
Metadata
Release files for pycub-studio 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycub_studio-1.0.0.tar.gz | 47.8 MB | With provenance | Details for pycub_studio-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycub_studio-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pycub_studio-1.0.0-py3-none-any.whl |
Total release size: 95.7 MB
Release files / pycub_studio-1.0.0.tar.gz
| Download URL | pycub_studio-1.0.0.tar.gz |
|---|---|
| Size | 47.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
922331e21bd57c790fc9f2cb29d3233116be28d84b457c7ff94690f2cb1cc103
|
|
BLAKE2b-256 checksum How to use checksums |
e94cb8c4503c49d08ae8d8e815b269361525074ec1b706d13043f3293d7d3cac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / pycub_studio-1.0.0-py3-none-any.whl
| Download URL | pycub_studio-1.0.0-py3-none-any.whl |
|---|---|
| Size | 47.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b649e2bb20ad16b581e90992961f1c37226418e60ebab8a10f7599156cd01302
|
|
BLAKE2b-256 checksum How to use checksums |
e66f9dac1390dbcc05136fdbacf82cd09ba6c576662e008767dff06114de564e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for pycub-studio 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pycub_studio-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.