Building an AI Robot that can be trained! || Using an NVIDIA single board computer

Hi there, recently I have been thinking about
the topic of AI or Artificial Intelligence. As a practical and very interesting example
we can have a look at Tesla's self-driving cars which utilize AI for this feature. According to the Internet Tesla's AI chips
make assessments of the traffic situation for guiding the car accordingly. And that is pretty close to the definition
of Artificial Intelligence according to Wikipedia which it describes as „any device that perceives
its environment and takes actions that maximize its chance of successfully achieving its goals„
Needless to say this AI concept sounds wicked, I means just imagine combining a small computer
that runs an AI software with a camera as a sensor input and two motors with wheels
to let it drive around. By feeding the computer with data on where
to drive and where not to drive according to its camera image input, we can basically
build our own autonomous vehicle.

The only problem is that the software aspect
for AI or Deep Learning which is also required for such tasks is super complicated. Thankfully though the software PyTorch does
exist which is still complicated to use but you can definitely achieve some decent results
with it. And that is why in this video we will go on
an AI adventure together in which I will show you how I built a small robot that I trained
with around 600 pictures I have taken with it in order to let it drive around autonomously
in my corridor without hitting any objects. Let's get started! This video is sponsored by Elektor & Sparkfun
who released a special edition of Elektor Mag 3 days ago! This edition is the result of a ‘secret’
creative collaboration between them! That is why Elektor is offering my viewers
a 20% discount on a print copy and 50% discount on a digital copy of the new magazine, which
features exciting DIY electronics projects and engineering tutorials.

Check out the links in the video description
to grab your discounted copy of this collector’s item! First off we need some kind of small powerful
computer. And yes, using a Raspberry Pi was also one
of my first ideas, but I quickly learned through for example this graph created by Q-Engineering
that it apparently was not powerful enough for Deep Learning tasks. A single board computer that achieved useful
results however was the Jetson Nano manufactured by NVIDIA. The reasons is that it comes with a way more
powerful graphical processing unit or GPU which the AI or Deep learning software can
use to run tasks in parallel. And while researching this development board
I have never worked with before I realized that there already exists a project based
around it which is called the JetBot. It basically combines the computer with a
camera, motor driver + motors, OLED display and a chassis to create an AI robot which
is just what I was looking for. Now of course you could order the components
for this robot by yourself and then 3D print the chassis but I went with the simpler route
by simply getting a pre-made kit from Sparkfun.

The really handy thing is that you not only
get all components necessary for such an AI robot build this way but you also get a pre-flashed
micro SD Card which comes with all of the software installed as well as all configurations
for the hardware. This is important since the hardware components
use I2C and that can be a bit tricky to configure for beginners. But anyway with all the components in my hand,
I had a look at the assembly guide on the Sparkfun website and started like described
by attaching the motors to one base plate. After then adding several stand-offs, the
caster ball and the wheels, I already had the part of the robot completed that could
drive around. So I continued by assembling the camera holder
to which I obviously secured the camera before I mounted it all to the other base plate. Then I added more stand-offs as well as the
given power bank through the help of kind of Velcro tape, combined the upper and lower
base plate and mounted the motor driver before I finally unpacked the Jetson single board

And I have to say that it looked rather promising. So I added a Wi-Fi Bluetooth dongle to it
and inserted the given SD card before I mounted it on top of the robot. After then connecting the camera to it, I
screwed the OLED Display in place and pushed a breakout board onto the SBC which I used
to not only power the motor driver but also to connect all the devices to one another
through their I2C data lines. And just like that after around 2 hours of
assembly I got my AI robot but of course the AI part was still missing.

So I powered the computer through the power
bank and after a few minutes the OLED Display told me that the system was not connected
to the internet, who would have thought? To solve that I connected a small display
along with keyboard and mouse to the computer in order to connect to my wireless network
through the Ubuntu graphical user interface. As soon as that was done, I shutdown the computer,
disconnected all devices and plugged its power once again in to see the IP Address of the
system in my network. By entering this IP Address in a browser while
using the Port 8888 we can enter the Jet Bot's browser based programming interface which
combines explanation text, code and graphics to give beginners a real easy entry when it
comes to using this robot. And when I say easy, I mean the beginners
tutorials like basic motion and teleoperation but when it later comes to collision avoidance
and thus deep learning and AI I was rather happy that those guides already existed because
I doubt that I could have ever used the AI feature otherwise.

But anyway I skipped the basic motion guide
and went straight to the teleoperation example. There I plugged in a gamepad into my computer
and connected it with the software in order to remotely control the robot while also seeing
a live feed of its camera input. This example basically told me that I assembled
the robot correctly and it also explained me how to do simple programming for the robot
functions through Python which is a programming language that is also used by the Raspberry
Pi. I even created a kind of video about it while
trying out a microcontroller that uses Micro Python so feel free to watch that if you have
no idea how Python works. But anyway even though this example was fun,
I wanted to move on to the AI part and after reading through the 3 given guides, I had
a idea of what was going on.

First off I needed to take lots of pictures
of where I wanted the robot to drive around which I would have to classify as either blocked
so turn around or free to go. With the help of this database and the PyTorch
software, the computer then creates an algorithm by itself which will compare to what it currently
sees with the pictures from the database in order to decide whether to move forward or
turn around. And last but not least the robot obviously
drives around while using this algorithm in order to avoid obstacles. Now with the theory out of the way I started
this AI task by taking around 600 pictures inside my corridor where the robot should
stop and where it could drive.

After this one hour long task, I let the computer
do the complicated deep learning calculations and after then starting the live test script
it seems like the AI feature really seems to work. It was quite fascinating how the slider moved
from free to go to blocked while reaching pictures of blocked positions and then turning
around. So needless to say I think this AI robot project
is awesome and it taught me quite a bit about deep learning and AI software. Of course you can extend this object avoidance
example by feeding way more pictures into the system or you can even use the given AI
software in order to classify different objects. There are tons of options to go from here
so feel free to have a look at the robot by yourself and start exploring all the possibilities.

With that being said thanks for watching. As always don't forget to like, share, subscribe
and hit the notification bell. Stay creative and I will see you next time!.

Watch this on YouTube

Add Comment