The drone itself is a very integrated system. In terms of the basic core flight control part, it generally consists of an inner loop and an outer loop. The inner loop is responsible for controlling the attitude of the aircraft, and the outer loop is responsible for controlling the trajectory of the aircraft in 3D space.
High-end drones rely on advanced sensors such as high-precision accelerometers and laser gyros (the ones that are popular nowadays are based on Jet-link inertial guidance rather than platforms) to calculate and maintain the aircraft's attitude. Lower-end models use some MEMS devices for attitude estimation. But their math is basically the same. Specific algorithms, depending on the capabilities of the hardware platform, may use discrete cosine matrices/quaternions/bisons/multisons ....
High-end UAVs with AHRS/IMU use basically famous products from civil aviation or military. For example, the Leighton LN-100G/LN-200 for Global Hawk. These systems are expensive but sophisticated, and are often internally zero-locked laser gyros and the like. For example, the GPS-INS combination of the LN-100G, even if the loss of GPS, drift by inertial devices can still be controlled at 120m/min.
Low-end UAVs are not so precise, generally rely on GPS and other positioning systems for the outer ring control, and the inner ring of the MEMS gyroscope and accelerometer for attitude estimation.
If you look at a drone as a complete system, there are many other supports that are needed, such as mission planning, ground tracking, and so on....
Doing UAV programming depends on which aspect you are specifically referring to. If it's a flight control system, you'd need to be relatively solid in math, with a deep understanding of various matrix operations/control rates and whatnot. If you just want an existing platform with flight controls to do some tasks, then you need to consider it on a platform-specific basis. Some platforms offer task editors and even more flexible task scripts.
Copyright.