The process of programing the drone began with some debugging to determine what the issue was in the program Claude made. We figured out which portion of the code gave us issues, then used that to fix our other programs.
We used a concept found in FIRST Tech Challenge (Slightly less common) and FIRST Robotics Competition, where, instead of forward being in the perspective of the drone, forward is in the perspective of the driver, or rather, the field, since we are not tracking in the driver's heading.
We ran tests to detect color and found that the plane could only reliably detect color when it had landed on it first. We modified our enhanced manual control program to have to drone take off, have the opperator move it above a colored square, and land. In order for it to be as relevent as posible to the final task, when the drone landed, it autonomously changed it's LED color to the color it was detecting.
The first version of the final program was one that used the built-in move to coordinate functions. These proved to be quite difficult to work with, since they were not tuned for our drone
In the second version, we ditched the unoptimized functions for a custom P-loop. Inspired once again by competitive robotics (which actually use full PID loops), this controller uses the error between the target and actual positions and applies an angle change in proportion to the error. One could say our final code was version 2.x because the kp needed tuning. In a future version, we might modify some of the Z parameters and implement feedforward control for better a better gravity counter.
This was the result after tuning our kps for X, Y, and Z. Overall, it works quite well and the drone is able to maintain its position with minimal occiliations.
By the end of the week, the drone still could not complete the final course. This could be due to several reasons, but it is likely something in the final program not matching the PID tuning.