Day 3 - Section 1 - More obstacles avoiding

Site: ΕΛ/ΛΑΚ Moodle
Course: Robotics - 3D Printing - Internet of Things
Book: Day 3 - Section 1 - More obstacles avoiding
Printed by: Guest user
Date: Monday, 29 April 2024, 5:23 AM

Description

After the completion of this section the students will be able to:

  • program their robot to avoid an obstacle upon detection
  • make the robot drive and avoid obstacles continuously
  • create the code to detect obstacles to the left or to the right of the robot

Chapter 6.1 - Detect obstacle and avoid

Write the following program to have the Edison robot drive until it encounters an obstacle, then turn 180° and drive for 1 second away from the obstacle.


Use the right amount of time to have the robot to turn 180°, where indicated above by the orange question mark (?).

Chapter 6.2 - Continous obstacle avoidance

Write the following program to have the Edison robot continuously drive avoiding obstacles.


Try experimenting with different amounts of time in the second event wait icon. This time setting determines how long the robot turns for and is indicated above by the orange question mark (?).

Chapter 6.3 - Right and left detection

Write the following program to have the Edison robot continuously drive avoiding obstacles to the left and right.

In the above program we are using ‘IF’ icons. These are very important icons, because they give the robot the ability to make decisions without human guidance. When this occurs in a robot it is now called an autonomous robot, as it has artificial intelligence.

An ‘If’ icon asks whether a condition is true or false. If the result is true the program takes the path with a tick. If the result is false the program takes the path with the cross.

The above program has three different paths that it can take based on where an obstacle is.