Every task has its own function and world. At the start of each task, you should load the world for that task. To do this, in the Webots program, do:
File -> Open World -> [pick the world with the right task number]
If you don't see the worlds, they should be in the following folder: highbury-school-volunteering-project -> highbury-grove-vol -> worlds
The folder structure looks like this:
You don't need to worry about a lot of these folders. The files below are the only ones that you need to interact with.
example_task_solutions
contains videos for what each task result should look like.highbury-grove-vol/worlds
contains each world you need to load for each individual taskhighbury-grove-student_file.py
is the file that you will write your solutions to each task inbeginner_python.ipynb
is the file containing helpful Python hints and how to get started with codingguide_sheet.md
is an overview of the projectREADME.md
is this file!
When you open Webots, this is the view you should get.
On the right hand side of the program is where the Python code is kept. This `student_file.py` is what moves the robot and will be what you should change to complete the tasks. If this file isnt there, or you accidently close it, you can reopen it by doing:
Tools -> Text Editor
The file is located in this location:
highbury-school-volunteering-project -> highbury-grove-vol -> student_file.py
If you accidently change the view of the camera in the world, you can easily get it back by doing:
Control + Shift + V
Or by hitting the button on the program with arrows circling an eye.
Finally, make sure not to hit 'Save World' as this will overwrite the world that you are using. To make sure this doesnt happen, make a copy of the folder and store it somewhere else and then you can replace it if you change anything accidently.
pip install controller
- Download Webots from
https://cyberbotics.com/
- Get the robot to move in a straight line.
- How could you get it to go at a different speed?
- Get the robot to move in a circle
- Is there a way that you can change the size of the circle?
- How about making it go the other way around?
- Now can you make the robot turn clockwise whilst staying on the rounabout road?
- How about turning on the roundabout in an anticlockwise circle?
-
Now we introduce a type of sensor onto the robot. They are called distance sensors and there are two located on the front face of the robot. They are named 'ds_left' and 'ds_right'. When printing out the values of these sensors they will always output 10 until they get close to an obstacle. Then the values will start to decrease.
-
Can you get the robot to stop before it hits the crash barrier? (you may need to use an if statement)
-
How would you get it to stop at a different point to the barrier? (i.e. closer or farther away)
-
Think about how this could be applied to real-life
- There is a new sensor! Now we are introducing a light sensor. This is similar to the distance sensor, there are two of them (i.e a left and right) in the same location as the distance sensors and their values range between 0 and 10. The more light they detect the higher the value the sensor outputs.
- There are now lights on the robot arena. They have no physical presence, so the distance sensors will not be able to detect them.
- Here is the code we came up with for the robot to use the light and show anger
- How might you have done differently?
- Can you see how the robot is using the light sensors?
If you let vehicle 3b
move around in the world for a while
with the source it turn toward the source and eventually hit it. There is no escaping: as long as vehicle 3b
stays in the vicinity of the source, no matter how it stumbles and hesitates, it will hit the source frontally in the end. Vehicle 3b
gets excited by the presence of source, but resolutely turns toward them and hits them with high velocity, as if it wanted to destroy them. vehicle 3b
is AGGRESSIVE, obviously
- Now we give out interpretation of how a robot might display fear
- What would you do, would you do it similarly or in a different way to us?
If you look closely, you will notice that both vehicle 3c
fear and vehicle 3c
- anger have one thing in common, even though their characters are quite opposite. They Both DISLIKE the light source. vehicle 3c
becomes restless in it's vicinity and tends to avoid them, escaping until it safely reaches a place where the influence of the source is scarcely felt.
- Now it is your turn.
- Use the light sensors and try and get the robot to show love
- Research the applications of this technology
- One interesting fact about automated vehicles
- Any pro’s and con’s - think about the environment, accessibility for everyone in society, costs, road accidents
- Near future applications on this type of technology
- Check out this videos on AI and Robotics: https://www.youtube.com/watch?v=yCXm5cgG0UA
- Meet the AI Robot capable of Human Emotion: https://www.youtube.com/watch?v=wGWVKkYEHBE
- How do you think this technology will change our world?
- Do you think it will have a positive or negative impact on society, and why?
- What can you imagine we could use this type of technology for in 100 years
- Think about how it’s being used now, how it’s planned on being in the future, and what you would do differently
- How could it improve the world we live in?