webots_intro
Setup
Coventry lab machines
Installation
- Open AppsAnywhere.
- Search for and install Webots (R2020b-rev1).
Additional Python steps
- Open AppsAnywhere.
- Search for and install Python (Anaconda Python 3.4).
- Open Webots.
- Edit Tools -> Preferences -> "Python command" option to "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python".
Personal machines
Installation
- Download from https://cyberbotics.com/.
- Install.
Although these activities should work with the latest version of Webots they were tested against R2020b-rev1. Previous versions of Webots are available at https://github.com/cyberbotics/webots/releases.
Additional Python steps
- Install Python 3.7, 3.8 or 3.9.
- If Webots is unable to find your Python install you may need to edit the Tools -> Preferences -> "Python command" option within Webots.
Getting started
Open one of the sample environments using the File -> "Open Sample World" -> dji -> mavic -> mavic_2_pro.wbt
Camera controls
- Pan/Tilt camera - click and hold left mouse button in simulation window.
- Move camera - click and hold right mouse button in simulation window.
- Roll camera - click and hold middle mouse button in simulation window.
Control simulation
- Play, pause and fast forward options on top menu bar.
- Can also step through the simulation one timestep at a time.
- Reset simulation to the start (rewind icon).
Move objects
- Whilst holding Shift key, left click and drag on object.
- Or, left click on object and use movement arrows.
Rotate objects
- Whilst holding Shift key, right click and drag on object.
- Or, left click on object and use rotation arrows.
Modify objects
- Select object in the scene tree (menu on left hand side).
- Change attribute values.
Robot window
View the sensor information from the robot in the robot window.
- Double left click on the robot.
- Or, right click on the robot and select "Show Robot Window".
Write control code
- Select robot in the scene tree.
- Select controller attribute.
- Use "Select..." button to see available controllers.
- Use "Edit" button to open the code window.
- Controllers are stored in the "controllers" follow in seperate directories.
- The controller program must match the name of the folder to be automatically detected.
- I.e. controllers/myController/myController.py for Python and controllers/myController/myController.cpp for C++.
- You will need to compile your C++ code, there is a compile button in the code window (the cog icon).
Documentation
The Webots documentation is available at https://cyberbotics.com/doc/guide/index.
In particular the programming documentation is availabel here https://cyberbotics.com/doc/reference/index.
Activities
Using a modified version of the GCTronic E-puck.
Line follow
- Open Webots.
- File -> Open World
- Select the worlds/linefollow.wbt file from this repo.
- Create your own version of the example_line controller to navigate the course and quickly as possible.
Line follow with avoidance
- Open Webots.
- File -> Open World
- Select the worlds/linefollow.wbt file from this repo.
- Move the robot to the second course (features 3 obstacle blocks).
- Create your own version of the example_line controller to navigate the course and quickly as possible.
Sumo
- Open Webots
- File -> Open World
- Select the worlds/sumo.wbt file from this repo
- This is a two robot environment, the red and blue E-pucks can each run seperate controllers.
- Develop and test your controller against each other. The objective is to push the other robot out of the ring.