The attitude controller works around the concept of the desired attitude, target attitude
and measured attitude. The desired attitude is the attitude input into the attitude controller
that expresses where the higher level code would like the aircraft to move to. The target attitude is moved
to the desired attitude with jerk, acceleration, and velocity limits. The target angular velocities are fed
directly into the rate controllers. The angular error between the measured attitude and the target attitude is
fed into the angle controller and the output of the angle controller summed at the input of the rate controllers.
By feeding the target angular velocity directly into the rate controllers the measured and target attitudes
remain very close together.
Calculate the velocity correction from an angle error.
The angular velocity has acceleration and deceleration limits
including basic jerk limiting using _input_tc
thrust_vector_rotation_angles - calculates two ordered rotations to move the attitude_body quaternion to the attitude_target quaternion.
The first rotation corrects the thrust vector and the second rotation corrects the heading vector.