Initial Installation (Erebus - Installation)
-
Download and install the simulation platform from
https://cyberbotics.com/ -
Initialize or update the Erebus submodule by executing the following command in this directory
git submodule update --init --progress
Optionally, you can check for new Erebus release using
cd erebus # List all release tags, sorted by date git tag --sort=committerdate --list 'v*' # Checkout the latest release tag (e.g. 'v23.0.4' in time of writing) git checkout v23.0.4
This is normally not required, as the submodule is committed with specific hash anyway, so the command in the previous step checks-out the correct specific version. This is useful as an occasional check for new releases, to be checked out and committed as a new submodule hash.
-
Setup virtual environment based on Pipfile (using PyCharm or by executing
pipenv install
in this directory) -
Run script
helper_scripts/setup_environment.py
using this virtual environment and follow its further instructions.
Some useful links:
This method enables running Python script directly from IDE (PyCharm), with full debugging support.
When Robot Controller (class Robot
) is initialized, wb.wb_robot_init()
call in its __init__()
method ensures that the Webots simulation is running and that the controller gets connected to it.
- Erebus Remote Controller Instructions
- Webots User Guide - Running Extern Robot Controllers
- Webots User Guide - Tutorial 4: More about Controllers (30 Minutes)
-
Run
helper_scripts/run_webots_for_external_controller.py
. This script will run Webots (or attach to already running instance) and enable Extern Robot Controllers. -
Run/Debug
code/main.py
in your preferred IDE - it will automatically connect to the Webots instance.
NOTE: You still need to load the robot definition file at least once, as described in the next section point 4.
-
Open one of the
.wbt
worlds located inerebus/game/worlds/
in Webots -
If Erebus Simulation Control web page did open automatically in the default browser, then in the left panel, right-click on
DEF MAINSUPERVISOR Robot
and click Show Robot Window. -
Click "LOAD" under Program icon () and load the
run.py
script. -
Click "LOAD" under robot icon () and load the
SERSy.json
robot definition file. -
Click the "Play button" to start the simulation.
As long as you don't move the code/
folder, you can just press the "Reset" and "Play" buttons,
to run the simulation again - run.py
will automatically reload main.py
.