Tello and OpenCV - Jack Pender, Blog #3
Introduction:
One of the main aspects of this project is to use a drone to
locate people who are in danger in the water, then transmitting this location
to the USV so that it can make its way there. The first step of this was to get
the camera feed from the Tello drone and stream this to a computer, in this
case, mine. In order to do this my first task was to research the topic online
and see if there was anything I could use. Luckily, there was.
First Steps:
There happened to be a few tutorials online, from articles
to YouTube videos, that were able to help me get started. The first step in
this process is connecting to the Wi-Fi network of the Tello drone, in order to
stream its camera feed via OpenCV. This is a public Wi-Fi network, so it’s very
quick and easy to connect to. Then came the python programming using OpenCV in
order to actually get the camera feed from the drone. The tutorials that I
found allowed this setup to be very easy. Firstly, you set up the parameters of
the stream window size, then send the initialization command to begin the
stream. Using OpenCV you can then capture this frame and display it in a window
on your computer. While this first attempt was a success, it also posed a problem;
How could anyone else see the stream?
Livestream Feed:
As part of this project, we plan on using a dashboard platform in order to display the various types of input and output of the USV e.g thruster voltage/current, co-ordinates, battery level etc. The camera feed of the Tello drone was another aspect of the USV that we wanted to display, however I was unsure about how I could get it from it’s windows on my computer up to the dashboard. Coordinating with the Dashboard team, there were various solutions that we came up, however for all of them to work it became clear that I would have to livestream the camera feed of the Tello.
Flask:
Knowing that I needed to livestream the camera feed of the
Tello, I set about doing so by deploying the stream as a Flask application. Luckily
Flask is very easy to set up and only requires a few lines of code. However, it
did mean that I would have to slightly change the way that the video feed was
being streamed. Rather than a video feed, the Tello footage was now stitched
together as a series of images instead. This didn’t cause any issues as it is
just as fluid as a legitimate video feed. This stream was then deployed via my
localhost network. This was good for testing purposes but in order for the
dashboard to have access to it, we would need to be on the same network. For
the real deal, the computer in use could simply have two Wi-Fi adapters, but in
my case, I only have one. To solve this issue I simply connected to the Tello
via Wi-Fi, but also connected my computer to the internet using an ethernet
cable, and it was through the ethernet cable that I launched my stream, which
allowed the dashboard team to be able to connect to the same network and access
the Tello stream.



Comments
Post a Comment