Instead of having a yawReference to command the drone to move to a set yaw, this code tries the following:
Set the currentYaw as the yawReference. This means that we are never correcting the yaw.
We take the yawRate from the RC and command a yawRateReference. We were not commanding any angular velocities previously, so we were feeding angularVelocityCorrected directly to the controller. Now we provide yawRateReference to the controller and inside the controller, we update it as
Ready to release
Main Changes
Instead of having a
yawReference
to command the drone to move to a setyaw
, this code tries the following:currentYaw
as theyawReference
. This means that we are never correcting theyaw
.yawRate
from the RC and command ayawRateReference
. We were not commanding any angular velocities previously, so we were feedingangularVelocityCorrected
directly to the controller. Now we provideyawRateReference
to the controller and inside the controller, we update it asThere were other similar implementations for yaw control, one such implementation can be found in
Ardupilot
.Associated Issues
Tests
Testing is done. The drone flies well. It stabilizes in the air; the drone was never found to yaw unnecessarily during the entire testing period.