From 9abe42025f870033380f753161f1ef6e2715b289 Mon Sep 17 00:00:00 2001 From: TsuyoshiKawamura Date: Mon, 20 Nov 2023 20:21:18 +0900 Subject: [PATCH] Copter: add nan check in handle_command_mount --- ArduCopter/GCS_Mavlink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index 4f5c8cd9f03e8..ece28b6372dec 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -846,7 +846,8 @@ MAV_RESULT GCS_MAVLINK_Copter::handle_command_mount(const mavlink_command_int_t case MAV_CMD_DO_MOUNT_CONTROL: // if vehicle has a camera mount but it doesn't do pan control then yaw the entire vehicle instead if ((copter.camera_mount.get_mount_type() != AP_Mount::Type::None) && - !copter.camera_mount.has_pan_control()) { + !copter.camera_mount.has_pan_control() && + !isnan(packet.param3)) { copter.flightmode->auto_yaw.set_yaw_angle_rate((float)packet.param3, 0.0f); } break;