# Lab 01: Line Following with Arduino Robot

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Lab 01: Line Following with Arduino Robot

## Objectives

The objectives of this lab is to develop a small line following application using Arduino Robot based on its IR sensors.
1- Implement the mapping between unicycle kinematics representation to differential drive kinematics and vice-versa.
2- Estimate the linear velocity and angular velocity and the robot in meter/sec and radian/sec.
3- Implement the odomerty for the Arduino robot so that it can estimate its current position.
This lab is practicing exercise on the capabilities and programming API of the Arduino Robot, that we introduced in the first lecture.

## Pre-requisite

• Make to download Arduino. Although you can work in any environment, it is recommended that you work in the Ubuntu Virtual Machine provided to you. Download and install Arduino 1.0.6. For other versions, refer to Arduino Download page.
• You need to review the Arduino Robot Library, in particular the function UpdateIR that contains a simple example of how to read the values of the five IR sensor as an array.
• Get used to Arduino Robot and its API.

### Instructions

The task consists in programming a line following application. For your reference, note that the Arduino Robot comes with a Line Following mode in addition to the simple mode, as explained in the `Robot.setMode()` method. In this lab, you will work with the simple mode, and you will develop yourself the algorithm of the line following.
Note that the line should be of around 3 cm of width.

You need to observe the output of the IR sensor when they are put on a back surface or white surface. Use threshold values to develop your algorithm that makes the robot as much close as possible to the back line.
The robot should make the buzzer sound when it loses the line. It must also display on the TFT screen its orientation. The robot should stop if it detects a green colour.

### Performance Issues

The algorithm should avoid too much oscillations and maintain a smooth motion when following the line.

### What to submit

• a description of the line following algorithm (use flowchart)
• an arduino code of the line following algorithm
• testing the code on the real robot