Chapter 8. The Line-follower Robot

In this chapter, we will begin constructing a classic robot: the Line-follower robot. In the process, we will enhance our knowledge of LeJOS and put it through its paces. The creation of the robot will be divided into three parts, which will be covered in three chapters including this one. In this chapter, we will cover the following topics:

  • Learn about the Line-follower robot
  • Specify the functionality we desire from it
  • Discuss its physical construction (based on TRACK3R)
  • Implement a differential drive

The Line-follower robot

The Line-follower robot is a classic construction in the field of robotics that tests the robot's awareness of its environment and its ability to respond to it. A Line-follower robot is able to follow a path marked out on the floor (such as following the yellow brick road to visit the wonderful wizard of Oz).

You start by marking out the path on the floor for the robot to follow. The simplest means of achieving this is to use an electrical tape of a color that is easily distinguishable from the color of the floor (a high contrast makes the tape-floor boundary easy to detect). This immediately means that we will be using the color sensor to detect the path by determining whether the line is present at the robot's current position.

A number of variants exist for line-following, some of which allow the path to intersect with itself. We will focus on a simple variant with sharp corners/turns and no crossovers (where the path intersects with itself). Once we learn how to solve this, the other variants are easy to handle.

We start by clearly defining the behavior we wish to achieve. We will need to keep this in mind when we are programming the robot to ensure that it functions according to these specifications.

The required behavior

The following is the behavior required by the Line-follower robot:

  • The Line-follower robot is placed at the start of a path (marked out in tape) on the floor.
  • The robot is placed with its front (where the color sensor is attached) pointing roughly along the forward direction of the path.
  • The color sensor is initially on the path, that is, when the robot starts its operation, it will detect that it is already on the path.
  • The robot will start moving in a straight line.
  • Whenever the robot detects that it is leaving the path, it will pivot in its place to reacquire the path. This will allow it to follow the turns in the path.
  • Once it reaches the end of the path, the robot will stop and beep to indicate that it has completed its task.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.245.196