Monday 31 December 2018

Milestone 1 Complete

This is an update on the self driving car project. Milestone 1 has been completed.

Parts:
1 - Raspberry Pi Camera V2
2 - DF055B Servo with Pan Bracket
3 - USB Micro Battery Bank
4 - Raspberry Pi 3 Model B
5 - L289n Motor Driver
6 - 6xAA Battery Pack
7 - Arduino Nano
8 - 4xAA Battery Pack

4 Wheel Car kit Chassis from some Chinese distributor
(cheap but gets the job done, soon I will upgrade to an RC car with better motors, chassis and steering)

Power
At the moment I am using separate power supplies to avoid any additional power circuitry for now.
The 6xAA Battery Pack provides the 9V to the 4 motors
The 4xAA Battery Pack provides 6V to the servo motor
Finally the USB Micro Battery Bank is used for the raspberry pi.

Control
The Raspberry Pi is the main brain of the whole system which is running the control scripts to control everything and to interface with a controller.
The arduino nano is dedicated to servo control (due to real time PWM) which is controlled via serial commands from the Pi.
The controller is connected via bluetooth directly to the Pi.

Stream
Camera feed is streamed using netcat and named pipes. Essentially netcat is a udp/tcp transport program which encoded H.264 is sent over to the PC from the raspberry pi and then decoded on the PC. This allows for the use of Open CV and further machine learning on my GPU since the Pi doesn't have enough processing power. Even though there is latency due to streaming, this is still faster than allowing the Pi to process everything.

Self Driving Cars

With the rise in popularity of self driving cars due to companies such as Tesla and Waymo, we have made significant progress into making it more applicable in society.

Image result for waymo
Waymo car: Source

My next project will be creating a miniature self driving car where I will be exploring the basic problems of lane detection, stop sign detection and object detection.

Although these problems have already been solved, I intend to use this as a learning experience to learn about these existing solutions and perhaps add my own spin on things as I learn more about the subject.

I've broken up this project into several milestones to make the problem a bit easier to solve.

Here is my current rough plan:

Milestone 1:
- Make a remote controlled car using ps3 controller
- Be able to control camera and steering
- Stream image data to pc

Milestone 2:
- Basic open cv recognition (stop signs)
- Neural network on pc using CUDA (stream data from rc car)
- Make car stop at stop sign

Milestone 3:
- Lane detection
- Traffic lights

Milestone 4:
- Object tracking and following

Milestone 5:
- Upgrade to RC buggy car 
- Battery upgrade

Milestone 6:
- Finalize and make working

To make a self driving car using raspberry pi camera module and opencv
-Be able to stop at a stop sign for 3 seconds then go
-Be able to follow a traffic light
-Be able to navigate lanes
-Bonus goal - follow an object around