BWSI UAV Tello Passport
Resources for Programming Tello
Unit 1 - Connecting and Position Control
In this unit you will write code to connect to, receive telemetry from, and send commands to your Tello drone to allow you to fly in position control.
Challenges include:
If you get stuck, refer to the resources page and reach out to other students and your instructors for help!
Unit 1 - Challenge 1
Connect to your drone!
Write a simple script in your IDE of choice to initialize your Tello, connect to it over wifi, and display some basic information about the drone (e.g. battery percentage) to confirm that you have successfully connected.
When done, take a screenshot of your python output where you printed your drone information and paste it on the next slide to show us that you’ve completed the challenge!
Unit 1 - Challenge 1
Paste your screenshot here:
Unit 1 - Challenge 2
Now that you’ve connected to your Tello, it’s time to fly!
Write a script to connect to your Tello the same way you did in the previous challenge, but now, have the drone takeoff, hover for a certain period of time (e.g. 3 seconds), then land.
Hint: use the sleep() function from the time package to have the drone hover before it lands.
When done, take a picture of your Tello with your phone while it’s hovering and paste your picture onto the next slide to show us that you were able to complete the challenge successfully!
Unit 1 - Challenge 2
Paste your picture here:
Unit 1 - Challenge 3
Now that you can hover, takeoff, and land successfully, it’s time to fly your drone around with position control.
Write a script to fly around your room via commands that tell the drone to move a specific distance. (e.g. make your drone fly in a square)
Hint: The move() and rotate_clockwise() functions will help a lot!
Take a video on your phone and embed the link on the next slide. YouTube unlisted might be a good way to do this if you have an account.
Unit 1 - Challenge 3
Link your video here:
Unit 1 - Challenge 4
More position control flight!
Write a script to fly around a specific object in your room via commands that tell the drone to move a specific distance. (e.g. fly around a chair)
Take a video on your phone and embed the link on the next slide.
Get creative!!
Unit 1 - Challenge 4
Link your video here:
Unit 1 Instructor Sign Off
Congrats on finishing Unit 1!
Have an instructor or TA look over your work so far and write their name at the bottom of the slide to show that they’ve signed off on your passport.
They may also ask questions about your challenges including problems you encountered and how you went about solving those problems. Be prepared to answer!
Sign Off: _______________________________________________
Unit 2 - Tello Computer Vision
In this unit you will write code that allows you to stream video being taken by your tello camera drone via python’s open source computer vision library (Open CV).
Challenges Include:
If you get stuck, refer to the resources page and reach out to other students and your instructors for help!
Unit 2 - Challenge 1
Stream via your drone!
Write a simple script in your IDE of choice to stream video from your Tello’s camera and display via OpenCV.
Hint: Don’t forget to use the streamon() and get_frame_read() functions from the djitellopy package!
When done, take a screenshot of the opencv window with the tello camera pointing at your face with your face shields on and paste the screenshot on the next slide to show us that you’ve completed the challenge!
Unit 2 - Challenge 1
Paste your screenshot here:
Generating ArUco Makers
Generate your own Aruco Markers via the link: https://chev.me/arucogen/
Standard Parameters:
Can change:
Example
Unit 2 - Challenge 2
More practice with OpenCV (ArUco Markers)
Now use the aruco module from the opencv-contrib-python package to detect aruco markers from your Tello’s live camera feed. The goal is to detect ID numbers and be able to return the pixel locations of the four corners of the aruco markers that appear in your video stream.
Note: You may need to do a significant amount of research on your own for this challenge but do not be afraid to reach out to your peers and instructors for help.
When done, take a screenshot of the opencv window that pops up with the aruco marker detected by the script your wrote.
Unit 2 - Challenge 2
Paste your screenshot here:
Why ArUco Markers?
AR tags, or more specifically, aruco markers are helpful features that we can utilize when attempting autonomous flight because they are easily recognizable by computer vision algorithms that we write, can convey information based on their ID numbers, and can tell us about our drone’s relative distance and orientation from the markers
When flying autonomously, your drone will need to know it’s relative distance and orientation to the aruco marker that it detects. To know this information, you will need to extract properties of the aruco marker that that are not given to you by default by the function used in the previous section. Keep reading to learn how we will determine this information.
Unit 2 - Challenge 3
Get ArUco Marker parameters of interest
Since you are given corners, you can create a function that finds the average side length of the aruco marker and another that sets a target for the drone to follow at the center (centroid) of the aruco marker.
Write a python class called Marker with a constructor that takes in the ID and the four corner values of the aruco marker. When the constructor is called to create an object, call functions (that you will write as well) to calculate the marker’s average side length and centroid and store these values as object attributes that can be referenced when scanning markers in your autonomous flight scripts.
When done, have these values printed out anytime a marker is detected, then screenshot your python output while a marker is detected in your video stream and paste it on the next slide.
Unit 2 - Challenge 3
Paste your screenshot here:
More on ArUco Markers
Great, now we have information about how far our drone is from the aruco marker.
(average slide length, more pixels = closer, less pixels = farther)
We also know which direction the drone is pointing relative to the marker based on the location of the centroid to the middle of the video stream output.
(a little to the left, a little above, etc.)
This is great information, but how do we know where exactly our drone is relative to the marker?
This requires us to look at the shape of the marker.
Unit 2 - Challenge 4
Brainstorm a method for determining orientation and position relative to the markers.
Create another attribute in the Marker class that gives an indication of orientation and position relative to the markers.
Hint: This has to do with the camera’s perceived shape of the marker. You may also need to write one or more helper functions in the Marker class for determining this value.
When done, write an explanation of what you came up with and provide supporting images/videos on the next slide.
Unit 2 - Challenge 3
Explanation of solution here:
Unit 2 Instructor Sign Off
Congrats on finishing Unit 2!
Have an instructor or TA look over your work so far and write their name at the bottom of the slide to show that they’ve signed off on your passport.
They may also ask questions about your challenges including problems you encountered and how you went about solving those problems. Be prepared to answer!
Sign Off: _______________________________________________
Unit 3 - Tello Control
In this unit you’ll be using the knowledge you just acquired of PID and controls to write code to fly the drone semi-autonomously and incorporate autonomous components as you go.
Challenges Include:
If you get stuck, refer to the resources page and reach out to other students and your instructors for help!
Unit 3 - Challenge 1
Practice with the send_rc_control() function
Write a script similar to Unit 1 Challenge 3, except this time, use the send_rc_control() function and command your drone to fly in a perfect circle.
Take a video on your phone and embed the link on the next slide.
Unit 3 - Challenge 1
Link your video here:
Unit 3 - Challenge 2
Yaw ArUco Marker Tracker
Write an algorithm that commands the drone to takeoff, fly up to a certain height, and locate aruco markers. Then, adjusting only the yaw parameter of the send_rc_control() function, have the drone remain in the same position but autonomously adjust it’s orientation to face and track the aruco marker.
Hint: This may necessitate the implementation of a PID controller. Think of how you can utilize the code you wrote in Unit 2 to help you determine a way to calculate error to help with PID implementation.
When completed, film a video of you walking around your drone with an aruco marker in hand while your drone autonomously tracks the marker and adjusts its yaw to face the marker.
Unit 3 - Challenge 2
Link your video here:
Unit 3 - Challenge 3
Stationary Aruco Marker Tracker
Tape your marker on the wall. Then write a script to have the drone take off, locate the marker, and autonomously adjust all four parameters of the send_rc_control() function to command the drone to be flying right in front of the marker at a predetermined distance. This distance is up to you to determine. The goal is to implement PID controls for all four parameters such that if the drone were to be nudged/pulled/pushed during flight, it would quickly correct and return to the setpoint.
This is a tough challenge so get as far as you can and definitely reach out to your peers and instructors for help.
Post a video of your final progress to the next slide when completed or the week is over.
Unit 3 - Challenge 3
Unit 3 Instructor Sign Off
Congrats on finishing Unit 3!
Have an instructor or TA look over your work so far and write their name at the bottom of the slide to show that they’ve signed off on your passport.
They may also ask questions about your challenges including problems you encountered and how you went about solving those problems. Be prepared to answer!
Sign Off: _______________________________________________