mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
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:
parent
c0f0e3eca3
commit
5d6c979f70
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user