This project was made just out of pure interest in Self-Driving Cars. I've always wondered how cars follow lanes. During my 1st year of engineering I've worked with line following bots and thought why everyone uses a line sensing array and not a camera to follow the line. Using that motivation I've learnt about line detection and algorithms used to follow the line. Later in second year I've learnt ROS and Gazebo then I thought why not apply the line following to detect lanes and make the bot follow the lanes using a control loop like PID.
Few algorithms used for Lane Detection:
- Image Blurring : To remove noise
- Canny Edge Detection : To detect edges
- Hough Transform : To detect lines from edges.
The math behind all the algorithms is really good and is not that tough. I would recommend everyone to implement those algorithms from scratch in python. I've directly used openCV library here. I will write a blog post on these basic topics and you can find them in Blogs section
A list of commonly used resources that I find helpful are listed in the acknowledgements.
Using this repo is extremely easy if the prerequisites are fulfilled.
- Enter into your ROS workspace
cd catkin_ws/src
- Clone the repo
git clone https://github.com/SravanChittupalli/Lane-following-bot-in-Gazebo
- Then go to your workspace directory and run
catkin_make
- Start ROS core using command:
roscore
- Open a new terminal and use
roslaunch my2wr gazebo.launch
- Open another terminal and run
roslaunch gazebo_ros empty_world.launch
- Open a new terminal and cd into
ros_ws/lane_follow/scripts
- Enter
python main.py
This repo can act as our starting point in Self-Driving Car journey. This repo contains the URDF of a bot this bot can be spawned in any environment. The bot is equiped with a USB camera and has differential drive. You can perform different tasks like:
- Advanced Lane Detection
- Lane detection using Neural Networks
- Behavioural Cloning
This repo can act as a base so that you dont have to waste time building up a bot.
I am learning behavioural cloning. The next target is to feed in images of the road and the bot decides if it wants to turn, stop, acceplerate.
Distributed under the MIT License. See LICENSE
for more information.