top of page
Alberto
Delgado
Goal
The objective of this practice is to implement the logic that allows a quad-rotor to play a game of cat and mouse with a second quad-rotor.
In this exercise, the cat quad-rotor has to be programmed by the student to follow the mouse quad-rotor (which is preprogrammed and moves randomly) as close as possible without crashing.
Implementation
First we implement a color filter to take only the red color (the color of the drone to follow), the we use a mask to select only the drone and the the position and the depth of the drone, the we follow it.
To do this i use 3 PD controllers, one for each axis (x, y, z), as we see in the video the
drone takes off, goes away from the red drone to be at the right distance and follows it when it starts flying.
After modifying the PD values of each axis it is much more stable, as wee can see in the next videos, were if follows the drone mouse in the levels 1 2 and 3.
We can see that as it starts it stabilizes to be at the correct distance of the red drone.
Note that it takes it a time to start(around one minute), this is no fault of the program, it is because my computer is rather slow, and the takeoff function takes a lot of time to execute, it is not the most efficient method i it follows all the drones without problems.
Finally, there is a recuperation method were if it doesn't see the re drone starts slowly going up and spinning .
bottom of page