From 8d366c16fbf33484896f6fbdb161ab344f3febac Mon Sep 17 00:00:00 2001 From: Ohad Nir Date: Thu, 1 Dec 2022 10:40:57 +0200 Subject: [PATCH] Sub:consider RC_CHANNELS_OVERRIDE for pilot_input_failsafe --- ArduSub/GCS_Mavlink.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ArduSub/GCS_Mavlink.cpp b/ArduSub/GCS_Mavlink.cpp index b3de09af21..fa1e6de225 100644 --- a/ArduSub/GCS_Mavlink.cpp +++ b/ArduSub/GCS_Mavlink.cpp @@ -546,6 +546,19 @@ void GCS_MAVLINK_Sub::handleMessage(const mavlink_message_t &msg) break; } + case MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE: { // MAV ID: 70 + if (msg.sysid != sub.g.sysid_my_gcs) { + break; // Only accept control from our gcs + } + + sub.failsafe.last_pilot_input_ms = AP_HAL::millis(); + // a RC override message is considered to be a 'heartbeat' + // from the ground station for failsafe purposes + + handle_rc_channels_override(msg); + break; + } + case MAVLINK_MSG_ID_SET_ATTITUDE_TARGET: { // MAV ID: 82 // decode packet