REALM (Robotic Environment for Autonomous Learning and Mapping) is a template repository for building Webots-based robot simulation experiments centered around reinforcement learning research. The goal is to provide a clean, minimal starting point that can be forked and extended for new papers and experiments without having to rebuild the simulation infrastructure from scratch.
The repo provides:
- A pre-configured HamBot robot with sensors (camera, LiDAR, IMU, GPS, encoders) ready to use in Webots
- A Gymnasium-compatible environment skeleton for RL training with Stable-Baselines3 or PyTorch
- Environment/environment loading and management tools
- Two isolated Python environments — one for simulation/training, one for data analysis
- A calibration controller for manually driving the robot with keyboard controls
REALM requires Python 3.11 specifically.
macOS:
brew install python@3.11Linux:
sudo apt-get install python3.11Windows: Install Python 3.11 from the Microsoft Store to avoid PATH issues.
Download and install from the Cyberbotics website.
Linux users: Do not install Webots via Snap. Use the
.debpackage or tarball instead.
Windows: git-scm.com
Linux: sudo apt-get install git
macOS: brew install git
git clone <your-repo-url>
cd REALMpython setup/realm_install.pyThis will:
- Find Python 3.11 on your system
- Create
realm_venvwith all dependencies - Add the project root to the venv's Python path
- Generate
runtime.inifiles in all Webots controller directories
To remove the environment:
python setup/realm_install.py --uninstallmacOS/Linux:
source realm_venv/bin/activateWindows:
realm_venv\Scripts\activateIf you add a new controller under
simulation/controllers/, re-runpython setup/add_runtime_ini.pyto generate itsruntime.ini.
REALM/
├── setup/
│ ├── realm_install.py # Install / uninstall script
│ ├── add_runtime_ini.py # Generates Webots runtime.ini files
│ └── requirements.txt # Venv dependencies
│
├── realm_tools/
│ ├── robot_lib/
│ │ ├── hambot.py # Base robot class (sensors, motors, supervisor)
│ │ ├── my_robot.py # User extension template (inherits HamBot)
│ │ └── robot_tools.py # Shared robot utility functions
│ ├── simulation_lib/
│ │ ├── environment.py # Environment class and environment objects
│ │ ├── maze_parser.py # XML maze file parser
│ │ └── webots_torch_environment.py # Gymnasium environment skeleton
│ └── image_lib/
│ ├── feature_extractor.py # CNN feature extraction
│ └── image_feature_lib.py # Image processing utilities
│
├── simulation/
│ ├── controllers/
│ │ ├── example/ # Example Webots controller
│ │ └── calibration/ # Keyboard-driven calibration controller
│ ├── protos/ # HamBot and world object Webots protos
│ └── worlds/ # Webots world files and maze XMLs
│
├── data/
│ └── DataCache/ # Temp files used by the display system
│
└── docs/ # Figures and documentation assets
The intended workflow when forking this repo for a new paper:
- Robot logic — subclass
HamBotinmy_robot.pyand add your experiment-specific methods (action sets, observation processing, etc.) - Environment — fill in the
WebotsEnvskeleton inwebots_torch_environment.pywith your observation space, reward function, and episode logic - Controllers — add new Webots controllers under
simulation/controllers/then re-runadd_runtime_ini.py - Personal files — your personal robot subclass (e.g.
yourname_robot.py) can be gitignored so the template stays clean for others
A keyboard-driven controller is provided for manually testing robot behaviour in Webots:
| Key | Action |
|---|---|
| Arrow Up | Forward |
| Arrow Down | Backward |
| Arrow Left | Turn left |
| Arrow Right | Turn right |
| Any other key | Stop |
Open simulation/worlds/calibration.wbt in Webots to use it.