We’ll be using the knowledge we just acquired of PID and controls to write code to fly the drone semi-autonomously and incorporate autonomous components as we go.
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.
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.
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 set point.
Warning This is a tough challenge so get as far as you can and reach out to your peers and instructors for help. Post a video of your final progress when complete.