Understand heading angles (0 to 360 degrees).
Combine turning blocks and motion blocks to turn the drone to the proper headings for flying in a square and triangle pattern.
Use repeat loops to fly in the same pattern using fewer code blocks.
Learn about the geometry concept "exterior angles".
+ New Project
via "MY PROJECTS". Choose the template that matches the model of your Parrot drone. Here we use the Parrot Airborne Night as an example.Heading angle is the angle that the drone is facing or pointing.
The figure below shows heading angles at 90-degree increments. To turn a full circle, a drone has to turn its heading angle for a total of 360 degrees.
Motion
category, turn right by 90 degrees
, to turn the heading angle of the drone by a specified angle.repeat
Loopsrepeat *n* times
loop is used when the number of iterations can be calculated and known in advance. In our case for flying along a square route, the same blocks (move forward for 2 secs
and turn right by 90 degrees
) will be performed 4 identical times. Therefore, we can use the block repeat 4 times
to replace the redundant blocks, and the program would look like this:In geometry, an angle of a polygon is formed by two sides of the polygon that share an endpoint. An exterior angle (or external angle) is an angle formed by one side of a simple polygon and a line extended from an adjacent side. This is the turning angles that you’ve been calculating throughout this lesson.