Line Following Robot
This is the final project for the Deep Learning class lectured by professor Chia-Han Lee in National Chiao Tung University (NCTU), Fall 2020. The objective of the final project is to build a robot to win a line-following competition. This robot has completed the tracks with perfect scores and won first place out of 10 teams. This project used object segmentation techniques for filtering out the line track, and calculates the steering angle and moving speed of the robot. The robot speeds up on straight line tracks and slows down when the curvature of the track is greater than a certain angle.
Method
This project adopts a traditional image processing approach, which is the image segmentation via HSV image. The input of the robot is a sequence of images captured by its front camera. The line track to follow is composed of yellow and blue lines and the floor is basically all-wooden texture. This method aims at identifying the line track from the image and calculating the cursing direction based on the line segment.
The method consists of three steps:
-
Obtain the center of the line track: Mask out the pixels of the background and calculate the geographical center of the line track.
-
Center adjustment: The calculated center point might not be inside the line track. Following this direction could lead to line track departure. Hence, the center point is horizontally adjusted in this step.
-
Steering angle calculation: The degree between the center point of the line track and the robot is calculated this step.
The details of the method are presented in this video.
Demonstration
- Video demo 1, click here.
- Video demo 2 (with faster speed), click here.
Code and Dataset
- To train and test (infer) the model/algorithm, use
main.py
. - To run the robot, use
line_gogo_from_ori.py
. - The dataset can be downloaded here.
Team Members
Ardian Umam, Po-Yuan Jeng, Shih-Wei Chiu, and Jeng-Jung Chen.