hi everybody this is Tiziano and
today we are going to connect this whith
this. And now what are those this is
an Autopilot compatible with Ardupilot
or PX4 stack and on this side I
have a Raspberry Pi 3. Now there are tons
of other companion PC that you might
suit your application even better than
things you know more powerful but the
Raspberry Pi 3 is a very good starting
point because it's cheap and because it
has a great support from the community
back in the previous tutorial we showed
how easy is to write a Python code that
connects and controls and how to pilots
like this one in order to simulate the
auto pilot and the drone we use the
software in the loop running on our
Ubuntu virtual machine but this time we
are actually doing the thing for real so
we are connecting this board where we
are setting up the environments to this
autopilot in this tutorial we're going
to follow a step-by-step procedure that
will get your Raspberry Pi ready for
controlling your drone through your
computer and how we're going to do that
first of all we're going to download and
install the reverting system in our case
it'll be a raspbian light but it could
be also a boon to and if you like there
is it a link in the description below
then after having activated SSH on the
companion PC and for that we will need a
minor keyboard and an Ethernet
connection we will move to my computer
and we will do everything else remotely
in the end we are going to download my
repository my github repository we were
going to modify one of the script that
we developed for a previous tutorial and
we are making those two boards talk
together for real now what is really
amazing is that everything will happen
without never attach another keyboard or
screen to this board anymore because
we're gonna do it everything with SSH
and through shared folder in the end
we're gonna connect the Raspberry Pi to
the autopilot using a USB cable and then
it'll be okay for our example but for a
real application i really suggest we use
the telemetry port on the autopilot
following this schematic over here you
got it okay now if you're excited you
can follow me Internet
tutorial we start off by downloading the
raspbian light from the Raspberry Pi org
website then we put in a microSD card in
the computer and we use a tool for
format the SD card in our case SD
formatter for and we're going to be
using win32diskimager for writing the
image onto the SD card then you connect
a monitor a keyboard and a mouse and
then you power it up and it's ready
insert Pi as logging and raspberry as a
password we open raspy I config and we
activate SSH
then we reboot in our computer we open
putty on Windows and we insert pi @
raspberry pi dot local as the address
open the RSP I config menu then we then
we set the local time in my case is
central then we activate the camera
interfacing option camera then it's very
important that we select interfacing
option and we go to serial and we
disable the serial login shell plus we
want to activate the hardware studio
then we reboot now we're gonna run a
sudo apt-get update and then a sudo
apt-get upgrade that it will take a long
time so be patient now let's set up the
Wi-Fi connection edit the file WPA
supplicant kampf and here you set up
your network with the SSID your password
and also the priority in case you have
multiple Wi-Fi available and then scan
SSID as one in case your SSID is hidden
now it will increase the swap memory
through 1024 so we added the DS swap
file and we said come to swap file to
1024 control accent save it and we
reboot the service now we activate the
x11 tunneling let's modify the file
sshh sshh the underscore config and here
x11 forwarding yes x11 display offset 10
x11 used localhost yes now we're going
to install Samba for easy install folder
sharing management so we should up get
install Samba and some common bin then
we are going to create a shared folder
that's
create a directory drone and then we
modified a Samba config file first of
all we're gonna set up wind support yes
and we're gonna set the net buyers name
as raspberry and then the workgroup name
is worker up in our case Indiana we are
gonna set up the shirt folder we create
a PI drone shared folder we set the path
as home PI drone and then we set
browsable and writable now we set the
Samba password with SMB password and
we're gonna put russ berrie and confirm
it now we can browse on our Windows
machine here we go we find raspberry pi
and here we said raspberry pi / pi and
then our password that is raspberry now
we're going to set up the serial port
first of all let's list our serial port
TDY star and here is t2 I am a zero so
we modify the file boot config dot txt
if you haven't seen TTY m80 before you
just said enable UART is equal to one
and then we want to set the your
connection at very high speed because
the autopilot can go as fast as 1.5
megabit per second so let's set the
clock to 64 million now installed pip is
very important for installing Python
libraries
then we stole Python death then future
now we're going to install screen WX gtk
map Watley open CV numpy lib XML and Lib
X SLT those are important for compiling
and running drunk it later now let's be
sure that we have the Python serial
package
now we installed it now that we have
kids we're gonna clone the drug kit
repository and we're gonna compile the
library on the Raspberry Pi I found that
this method works much better than just
installing drumkit library because it
saves a lot of headaches in case you
have multiple connections so I strongly
advise you we compile drunk it in your
machine after everything is done we're
going to clone my Holland's work
repository in the folder drone we're
going to copy the script number three to
a new folder called my script and we
rename it to task connection and now
we're going to modify it of course we're
going to modify the file on our Windows
machine using the editor that you like
in my case I'm gonna use notepad plus
plus here it goes we're gonna delete the
software in the loop colon and then we
are going to set the connection string
as TTY AC m04 for a USB connection but
in case you want to connect with a
serial port you're gonna use TTY am a
zero and then the boat rate connection
that for the USB is 115 and 200 be sure
that you set proper baud rate even on
your auto pilot when you want to connect
it in the end we just run it on the
potty
so we can net the raspberry pi with a
USB cable and then we just run the file
and here it goes it connects and it
works like in my example so now that we
have our companion PC up and running we
can have serious fun now in the next
videos we are going to probably set up
other bores and for sure we don't do a
video about setting up even the
companion PC with computer vision
libraries like open CD and we're going
to be using them for our audience
tracking navigation I don't know you
suggest
but for now well thank you for watching
I wish you a Merry Christmas and I'll
see you next
year by
