Learning with pyCub: A New Simulation and Exercise Framework for Humanoid Robotics

Lukas Rustler, Matej Hoffmann · 2025

Read Learning with pyCub: A New Simulation and Exercise Framework for Humanoid Robotics by Lukas Rustler, Matej Hoffmann (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-01756.txt.

Introduction

Lukas Rustler and Matej Hoffmann released in 2025 pyCub, a Python-only simulation of the child-like humanoid robot iCub, built for teaching. Older simulators demand C++ and middleware that shut out beginners. Their version models the full robot, twin eye cameras included, plus the sensitive skin's four thousand touch points.

A ladder of exercises climbs from basic velocity and joint control to gazing, grasping, and reactive behavior. Everything runs in Python, with Docker images and videos provided. Difficulty scales to the student. The team already ran the framework through two editions of a humanoid robotics course. They pitch it as a first lab that students can actually enter. The code, lessons, and documentation are public.

Catalog record

CREATORLukas Rustler, Matej Hoffmann
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE23 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2506-01756

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Learning with pyCub: A New Simulation and Exercise Framework for Humanoid Robotics Lukas Rustler, Matej Hoffmann 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 similators (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 . I Introduction There is a number of good robotics textbooks, such as [ 1 ] , or [ 2 ] with a great video supplement, but few of them offer hands-on exercises, toolboxes, or robot simulators. The book of Corell et al. [ 3 ] is accompanied with a github repository with Matlab and Mathematica code. Peter Corke developed a Python Robotics Toolbox [ 4 ] . This toolbox provides tools for both dynamics and kinematics of robots and is a successor of Robotic Toolbox written in MATLAB [ 5 ] . Tutorials on robot differential kinematics using the Python Robotics Toolbox were presented by Haviland and Corke [ 6 , 7 ] . Sakai et al. [ 8 ] proposed an educational textbook with Python examples to explain several robotic algorithms for autonomous navigation. One part of our work is similar in the sense that we provide exercises that should teach core robotics. Fig. 1 : An example from the simulation environment showing the iCub humanoid robot with artificial skin (red dots), a table and a red ball that can be manipulated by the robot. There are other toolboxes for kinematics and dynamics [ 9 , 10 ] or self-calibration of robots [ 10 , 11 ] . As many robots are controlled and unified under ros ( ros ), there are frameworks based on this middleware. The authors in [ 12 ] created a ros toolbox for simulating robots with compliant actuators. Fischer et al. [ 13 ] proposed a framework that combines Conda and Jupyter Notebooks for a more accessible introduction to ros . Another interesting project is Unibotics [ 14 ] that provides web-based learning platform mainly for navigation and mapping. Furthermore, there are more specialized toolboxes, e.g., for modular industrial robots [ 15 ] or aerial robotic manipulators [ 16 ] . Our course is on humanoid robots, but due to the universal nature of such a platform, it can be used to teach several robotics topics, from kinematics and dynamics, over walking, gaze control, grasping, to human-robot interaction. Our objective thus was a robot simulator easily accessible by students that can be used for hands-on exercises from the course. We selected iCub [ 17 ] as it is a full humanoid and an open-source research platform. The dimensions of the robot resemble a four-year-old child and the geometry and kinematics is designed to mimic the human body as much as possible (at the joint level, not at the muscle level). There are 53 active dof . A unique feature of iCub is the whole-body artificial skin with more than 4000 individual tactile sensors. The robot has a legacy simulator “iCub SIM” [ 18 ] and a newer simulator in Gazebo [ 19 ] and offers its own training course [ 20 ] . However, getting the environment running is an intricate process, and the default control is in C++ using a yarp ( yarp ) [ 21 ] middleware, which is not suitable for beginners. After having run two editions of the course on the iCub Gazebo, with Docker containers and other infrastructure prepared, WE have evaluated the feedback forms and realized that the students complained about the complexity of the whole system. Thus, we decided to simplify the whole pipeline and create a simulator using Python, which is a more user-friendly language. The comparison of existing iCub simulators is in Table I . We are not aiming to replace the existing simulators, but to provide a more accessible way to iCub and humanoid robotics in general. iCub SIM iCub Gazebo pyCub Programming Language C++ with wrappers C++ with wrappers Python Middleware YARP YARP None Transferable to real iCub Yes Yes No Skin Yes Yes* Yes High-level planners Yes** Yes** No Physics Engine ODE DART*** Bullet Rendering Engine OpenGL OGRE Open3D (OpenGL) TABLE I : Comparison of pyCub with existing iCub simulators (iCub SIM [ 18 ] and iCub Gazebo [ 19 ] ). *Skin to Gazebo was added later by the community. **The planners are coming from the connection with YARP. ***By default, can be changed. We present pyCub , a Python physics-based simulator of the humanoid robot iCub. The simulator contains all limbs of the robot, together with the possibility to visualize view from the robot’s cameras and also with simulated artificial whole-body skin consisting of more than 4000 individual tactile sensors. The framework provides easy-to-use functions to control the robot in joint, velocity, and Cartesian space, and effortless access to proprioceptive, visual, and tactile sensors of the robot. Everything is written and accessible in Python, allowing even less advanced users to operate. The environment is fully customizable and allows to insert other objects—see Fig. 1 for an example. In addition to the simulator, we provide exercises of different difficulty levels ranging from basic control and movements to tasks typical for humanoid robots such as gazing, grasping, or whole-body skin processing and obstacle avoidance. The exercises can be further customized and allow difficulty adjustments and thus are suitable for learning (humanoid) robotics on different difficulty levels. The framework was deployed in two runs of a course on humanoid robotics. The code, documentation, videos, and exercises are available at https://rustlluk.github.io/pyCub . II Simulation Environment The first component of our work is the physics-based simulation environment. This Section details the implementation, customization options, and the most important methods for controlling the robot. II-A Technical Details The physics-backbone of the simulator is realized with the PyBullet engine [ 22 ] . This module was selected because it is open-source, multi-platform and does not require excessive computational resources—mainly compared to recent physical simulators such as Orbit (NVIDIA Issac Sim) [ 23 ] . The average performance with gui ( gui ) and skin enabled is around real time 1 1 1 Tested on Ryzen 7 PRO 4750u CPU. . The most computationally demanding aspects are the number of dof and the model used, which is very complicated and precise. Thus, when using different models, the performance can be much better. We provide a simplified model (without fingers; simpler meshes; etc.), with which the performance is

Read the complete text