Skip to content

jujhaar2409/line-follower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Line Follower

Purpose

This project is an assignment that was designed for the controls bootcamp under Technical Summer School at IIT Bombay. The repo for the bootcamp can be found here. The main goal of it was to get the participants to implement the theoretical knowledge on their own to test their level of understanding.

The solutions can be found in the branches jujhaar and Tejas for the distance and color method respectively

About

The python files contain starter environments in which you have to add your own code.

Your task is to add a PID controller to control the movement of the car/robot and make it follow the drawn path.

Get Started

Installing Python and VSCode

In case you do not have python, and a text editor installed then, we would recommend that you check out this video so that you have a nice setup to work with for the rest of the week!

Downloading and Running the code

Download the repo as a zip file by clicking on this link and expand it in a convenient location.

Now open a terminal inside the directory week 2 within the expanded folder. Then type the following commands to run the code.

pip install pygame
python line_follower_dist.py # for the dist method
python line_follower_color.py # for the color sensor method

Resources

PID Tuning

Refer to the last few sections of the week 1(click here) material for this topic, especially the python code at the end.

PID refresher

You can go through this PID Playlist for a quick refresher on what PID control is and how it is used. You don't need to watch the whole playlist, this is just to refresh a few key concepts that will be used.

Python and pygame resources(optional)

Methods

Two methods of solving this problem are listed below. You can use one of them or possibly even come up with your own method to tackle this problem.

Some extra details for each method are given in the comments in the respective files.

Color Sensor Method

In this method a few, say 3(try and see if more or less work better), sensors are placed in front of the car. Each of the sensors collects data about the color below(pygame has this functionality) and based on that the car is made to turn right or left. Watch this video for reference: video

The starter code for this type is in the file line_follower_color.py.

Distance Method

This method makes use of sensors to find the distance of the car from a certain reference and then the controller decides how much to turn and which direction. Watch this video for an explanation of how a more advanced type this method works: video

The starter code for this type is in the file line_follower_dist.py

The file itself contains more info about the code and implementation in the form of comments.

Attribution

Icons made by Freepik from www.flaticon.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages