- Installing Webots
- Extracting the .zip file
- Opening the world file
- Before running the simulation
- Running the simulation
- How it works
- Editing the source code
- Structure of the code
- The enviroment
- On Linux, run the command
sudo apt install webots
in terminal to install the Webots app. - On Windows, install the official executable file from the Webots website and run it.
Extract the .zip file. It contains two folders:
worlds
folder containing the world filescontrollers
folder with the actual source code for the controller of the e-puck
To open the world file of this particular simulation you have to first
- open Webots, then
- go to
File
and - click the
Open World
button. - navigate then in the location where you extracted the .zip file
- go to
Worlds
and - select one of the two simulation.
In some cases it may be neccesary to give running permission to the executable of the code manually.
If you run the simulation and the Webots console prompts you to do this:
- open up a console
- type
$cd /location_of_the_extracted_folder/controllers/Comenzi
- then to give executing permission type
chmod u+x Comenzi
To run the simulation simply click the play button from the above or press Ctrl+2
To increase the speed of the simulation press the button next to the play button or Ctrl+3
A console should pop-up in the bottom of the screen, if not, it can be activated using Ctrl+N
-The robot must always begin from the left side (the left wall).
-The start line and the finish line are physically denoted by two small black tapes on the floor.
-The robot has four phases:
- Following the left wall from the start towards the finish line.
- Once arrived at the finish line, it stores the distance from the start line to the finish using left wall. It then continues its run along the same left wall.
- At the start line once again in stores the distance of the right wall.
- A last run is made following the shortest wall found towards the finish line.
If you want to change the source code, select edit from the controller menu
-
Select the file you wish to edit then press open
-
Edit the code then build the code by pressing the
button ( don't forget to save it before)
-
Press
Reset
the start the simulationThe code is modularized in 4 different modules that are connected through an header file with the main source as shown below
More about every module can be found here
There are two world files included in the
worlds
folder, each one containing a maze.More about the world files can be found here