COPTER: Fix MOUNT_CONTROL yaw in missions

If a the mount instances (gimbal) does not support yaw/pan control, the
copter needs to yaw in response to a DO_MOUNT_CONTROL command in
missions.  Checking if the mount has pan control, and if not, yawing the
copter was missing from the mission commands logic. As such, a
MOUNT_CONTROL command would control pitch but not yaw/pan.  This patch
impliments checking for pan control, and initiating copter yaw as
required.
This commit is contained in:
Matt 2017-12-22 15:29:23 -05:00 committed by Randy Mackay
parent c0f0e3eca3
commit 5d6c979f70
1 changed files with 3 additions and 0 deletions

View File

@ -1182,6 +1182,9 @@ void Copter::ModeAuto::do_digicam_control(const AP_Mission::Mission_Command& cmd
void Copter::ModeAuto::do_mount_control(const AP_Mission::Mission_Command& cmd)
{
#if MOUNT == ENABLED
if(!_copter.camera_mount.has_pan_control()) {
_copter.set_auto_yaw_look_at_heading(cmd.content.mount_control.yaw,0.0f,0,0);
}
_copter.camera_mount.set_angle_targets(cmd.content.mount_control.roll, cmd.content.mount_control.pitch, cmd.content.mount_control.yaw);
#endif
}