DEV Community

Cover image for AI: steering wheel console using cardboard 📦🚐
arsannnnn
arsannnnn

Posted on • Updated on

AI: steering wheel console using cardboard 📦🚐

Heyho!

I wanna share with you guys about my old project that i made in order to learn more about AI, especially, color tracking.

I try to be more creative by combinate it with car simulator. So here's the result.

This project was created using Python, OpenCV, SocketIO, and Udacity Self Driving Car Simulator

In this post, i'll show you how i made that with non-technical explanation. I'll explain to you all the step and flow in general without code pasted here.

BUT....

I will put the source code at the end of this post. It's free to learn or contribute.

🛠️ How I Made It
Watch these steps casually :)


DIY Steering

First, i made my steering wheel from cardboard and put color paper for origin and point.

image

Color Detection

Using OpenCV, i created new layer for color detection. I change the layer to HSV format, and gives limit for lower range and upper range.

image

So, that was what layer's color look like in HSV format. And for For limitation, this is the simple way.

"If color (in hsv) suitable with range that i set, show white. Otherwise, show nothing (in case, black)"

image

Centroid

So, i need to pointing the centroid area from color that i successfully track on steering wheel (origin & point).

image

Angle Calculation

When i already have the coordinates of my origin and point color on steering wheel, i can make a calculation for angle easly. This angle is affected by steer spin.

image

Emit to Simulator

Then, i have to send every number of angle change to Udacity Simulator using Socket. Yes, i sending the value over http method.

image

PLAY 🥳

All is setted up. All we need to do is enjoy and get the feel in riding car :)

image


Source Code 🎉

GitHub logo mtegarsantosa / ai-steering-sims

🚗 Artificial Intelligence for Steering Simulator

Top comments (0)