mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
AP_Mount: do-gimbal-manager-pitch-yaw can set lock state
Co-authored-by: davidsastresas <davidsastresas@gmail.com>
This commit is contained in:
parent
ce1e5481c8
commit
977dc2fde0
@ -358,6 +358,12 @@ MAV_RESULT AP_Mount::handle_command_do_gimbal_manager_pitchyaw(const mavlink_com
|
||||
return MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
|
||||
// if neither angles nor rates were provided set the RC_TARGETING yaw lock state
|
||||
if (isnan(pitch_angle_deg) && isnan(yaw_angle_deg) && isnan(pitch_rate_degs) && isnan(yaw_rate_degs)) {
|
||||
backend->set_yaw_lock(flags & GIMBAL_MANAGER_FLAGS_YAW_LOCK);
|
||||
return MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
|
||||
return MAV_RESULT_FAILED;
|
||||
}
|
||||
|
||||
@ -498,6 +504,12 @@ void AP_Mount::handle_gimbal_manager_set_pitchyaw(const mavlink_message_t &msg)
|
||||
backend->set_rate_target(0, pitch_rate_degs, yaw_rate_degs, flags & GIMBAL_MANAGER_FLAGS_YAW_LOCK);
|
||||
return;
|
||||
}
|
||||
|
||||
// if neither angles nor rates were provided set the RC_TARGETING yaw lock state
|
||||
if (isnan(packet.pitch) && isnan(packet.yaw) && isnan(packet.pitch_rate) && isnan(packet.yaw_rate)) {
|
||||
backend->set_yaw_lock(flags & GIMBAL_MANAGER_FLAGS_YAW_LOCK);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MAV_RESULT AP_Mount::handle_command_do_set_roi_sysid(const mavlink_command_int_t &packet)
|
||||
|
Loading…
Reference in New Issue
Block a user