Skip to content
English

Linux (Ubuntu)

Running the game server and controller programs on the same computer

Section titled “Running the game server and controller programs on the same computer”

First, try running the game server and your controller program on the same computer. This is not the same as the competition setup, but it is useful for debugging locally.

Open the world and press “TOGGLE REMOTE” in the control window. The button turns orange to show that remote mode is on.

The TOGGLE REMOTE button, turned on

If the control window is not displayed, right-click “DEF MAINSUPERVISOR Robot” in the Scene Tree and choose “Show Robot Window”.

Open a terminal and run the following commands, replacing <Your controller path> with the path to your controller program.

Terminal window
export WEBOTS_HOME=/usr/local/webots
"$WEBOTS_HOME/webots-controller" "<Your controller path>"

This assumes Webots was installed with the .deb package in /usr/local/webots. If you installed it elsewhere, change WEBOTS_HOME accordingly.

The controller connects to Webots and waits until the game starts.

Press the start button in the control window. The robot appears, and your program starts running.

To stop the game, press Ctrl+C in the terminal.

When the simulation ends, the Erebus game manager stops too. To run the game again, reload the world.

Running the game server on a different computer

Section titled “Running the game server on a different computer”

This is the setup used at official competitions. The computer that runs your controller (the client) and the one that runs the game (the server) must be connected to the same network.

  1. (Server) Start Webots on the server, open the world and turn on remote mode in the control window.

  2. (Server) Find the IP address of the server, for example with the ip addr command.

  3. (Client) Run the following commands, replacing <Your controller path> with the path to your controller program and <Server IP address> with the IP address you found in the previous step.

    Terminal window
    export WEBOTS_HOME=/usr/local/webots
    "$WEBOTS_HOME/webots-controller" --protocol=tcp --ip-address=<Server IP address> "<Your controller path>"
  4. (Server) Start the game by pressing the start button.

  • The controller cannot connect: check that the two computers can reach each other, for example with ping, that the firewall of the server allows TCP port 1234, and that the list of allowed IPs in the Network tab of the Webots preferences is empty or includes the client.
  • No robot name provided is displayed: this message is normal while the controller waits. If it does not go away, remote mode is not on: check the TOGGLE REMOTE button.
  • The controller does not find a Python library: the program runs with the Python installation of the client, so install the library there.

For more details about this setup, see the Webots guide.