Learning with pyCub: A Simulation and Exercise Framework for Humanoid Robotics
Lukas Rustler, Matej Hoffmann
TL;DR
pyCub provides a Python-based, open-source physics simulation of the iCub humanoid with a full articulation and a 4000-sensor artificial skin, designed to lower barriers to hands-on learning in humanoid robotics. Built on PyBullet, it offers joint, velocity, and Cartesian control modes, a custom GUI, and fully YAML-configurable experiments, with ready-made exercises spanning basic movements to gaze, reactive control, and grasping. Validated in two course runs, pyCub demonstrates improved accessibility over traditional iCub simulators that require C++ and YARP middleware, enabling students to focus on robotics rather than middleware. By offering easy installation (PyPI, Docker, GitPod) and Python-only control, pyCub facilitates rapid experimentation and paves the way for future extensions to planners, ROS interfaces, and more advanced topics like walking or event-based sensing.
Abstract
We present pyCub, an open-source physics-based simulation of the humanoid robot iCub, along with exercises to teach students the basics of humanoid robotics. Compared to existing iCub simulators (iCub SIM, iCub Gazebo), which require C++ code and YARP as middleware, pyCub works without YARP and with Python code. The complete robot with all articulations has been simulated, with two cameras in the eyes and the unique sensitive skin of the iCub comprising 4000 receptors on its body surface. The exercises range from basic control of the robot in velocity, joint, and Cartesian space to more complex tasks like gazing, grasping, or reactive control. The whole framework is written and controlled with Python, thus allowing to be used even by people with small or almost no programming practice. The exercises can be scaled to different difficulty levels. We tested the framework in two runs of a course on humanoid robotics. The simulation, exercises, documentation, Docker images, and example videos are publicly available at https://rustlluk.github.io/pyCub.
