In this section we will be using the drone camera and stream the contents to a Web camera to start off.
We will need to set a server using the web framework to access the video.
In this lesson we will be using flask.
We need to install the package.
But before that I want you to move the drone manager p p y file to a different directory.
Right click on the P Y Tello folder and choose new.
Then select directory let's name it to drone app and hit.
OK now right click on the drone app folder to create a directory.
Choose New and directory.
Let's create all the directories that we will be needing.
The first directory name will be controllers click on the drone app folder and you will see the new
controllers directory that we created.
Again we want to create a directory under drone apps.
This time we will name the directory to models continue creating the directories.
This time we set the directory name to templates.
This is where we set the flask templates.
We also want to use a static file so continue creating a new directory set the directory name to static
and head okay.
We just finished creating four new folders under the drone app directory.
Controllers models static and templates.
Now I want you to move the drone manager P Y file to the models directory.
When you see this message click OK.
Now the new path is the drone app.
Models drone manager P Y.
Once we move the python file we need to create the init file.
Right click our models and choose new python file.
Set the name of the file to double underscore in it.
Double underscore and hate OK we can close this tab.
We will set the main P Y to invoke commands by accessing the drone manager P Y the logging basic config
was set to receive the logs for this file so we can cut this line and move it to the main P Y pastebin
the line and let's not forget to import logging and sis.
Let's go back to the drone manager.
You can revise the script so it will fit the PEP 8 code style.
Also you can delete import sis.
Scroll down to the bottom the script.
You can also delete all the test commands that we set.
Now we've cleared this file so we can go back to the main copy why we won't set the main P Y to invoke
other files yet before we go on.
We need to install flask right click on the UI Tello and choose new.
We need to create a requirement document on text so let's choose file on the top set the file name to
requirements t x t and hit OK.
I also explained about the different package version we will be installing when we installed the open
CV.
You may have a slight difference depending on the version in this course we will be using these packages
open CV will be 4 point 0 point 0.
Point 2 1 num be one point one six point two flask will be one point 0 point 2.
So we set this in their requirement text.
Next we go to the terminal.
If you are using Anaconda you can directly install with Pip.
If you installed the python binary you can set Pip 3 install hyphen R requirements t x t and run this
code since my computer has all the packages installed.
There were no installation that started.
If you are missing any packages in your computer the installation process should have started.
Once you finish installing the package type Pip 3 frees to check if the installation process was done.
As you run this command a list of the packages will come up.
Check to see if you have installed the proper package.
You may see other packages installed also but be sure you have these three main packages.