Instructional Material: Find a Mission Pad

This exercise builds on FlyGrid to fly a grid search pattern and look for a Mission Pad. A Mission Pad is a mouse pad with a unique pattern printed on it.The pattern encodes a unique pad id number and some other information. The Tello comes with a set of these Mission Pads. The Tello has build-in programming to recognize Mission Pads when they are in view of the front or bottom cameras and read the encoded information from the printed pattern. You can read more about Mission Pads and how you can use them in the Mission Pad Uer Guide.

In our exercise we will use Tello-SDK commands to enable Mission Pad detection and the fly the grid search while monitoring for Mission Pad detection. If a Pad is detected, the search wil stop. When Mission Pad detection is turned on, the encoded information from any pad detected is returned in the status updates transmitted by the drone. Our code that monitors the status feed will record any such Mission Pad information in the Drone class, where we can access it.

Now how do we watch for Mission Pad detection when the drone is flying some fixed distance, and our flight code is waiting for the movement to complete? We need to monitor for pad detection independently of our flight code. To do this we create a separate thread of execution that will run code to watch for Mission Pad detection. You can read more on threads here.

A further issue is the fact that when the drone is executing a movement, like forward(100), the drone is controlling itself and does not return to our code (for a Mission Pad detection check) until the100cm movement is complete. This means the drone will overshoot the Mission Pad by some amount. To minimize this, the Mission Pad detection loop will issue the stop command to terminate in any in progress movements. The stop command helps quite a bit, but the drone will still overshoot the pad.

The FindMissionPad program flys the same search grid as FlyGrid. Place a Mission Pad somewhere in the grid area for the drone to detect. Note that the downward facing camera has a wide field of view so a pad may be detected even though it is to the side of the drone path of travel. You can adjust the turn around leg of the grid to allow for a wider search grid and so detect pads more directly under the drone. This issue will also be affected by how high the drone is flying. The higher the drone, the further the camera can see to each side of the path of travel.

Examine the FindMissionPad class to see how all of this is done then modify the Main class to execute the FIndMissionPad class.

 

Material Type: 
Lab Activity
Education Level: 
Middle School
High School
Focus Subject: 
Computing / Computer Science
Robotics Software
HW Platform: 
DJI Tello
SW Platform: 
Java
Interactivity Style: 
Mixed
Audience: 
Learner