diff --git a/Tools/scripts/build_options.py b/Tools/scripts/build_options.py index 1dd6d659b118e0..8b64dc07d988ea 100644 --- a/Tools/scripts/build_options.py +++ b/Tools/scripts/build_options.py @@ -369,8 +369,6 @@ def config_option(self): Feature('MAVLink', 'MAVLINK_VERSION_REQUEST', 'AP_MAVLINK_AUTOPILOT_VERSION_REQUEST_ENABLED', 'Enable Old AUTOPILOT_VERSION_REQUEST mesage', 0, None), # noqa Feature('MAVLink', 'REQUEST_AUTOPILOT_CAPA', 'AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED', 'Enable Old REQUEST_AUTOPILOT_CAPABILITIES command', 0, None), # noqa Feature('MAVLink', 'MAV_MSG_RELAY_STATUS', 'AP_MAVLINK_MSG_RELAY_STATUS_ENABLED', 'Enable Send RELAY_STATUS message', 0, 'RELAY'), # noqa - Feature('MAVLink', 'MAV_MSG_MOUNT_CONTROL', 'AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED', 'Enable Deprecated MOUNT_CONTROL message', 0, "MOUNT"), # noqa - Feature('MAVLink', 'MAV_MSG_MOUNT_CONFIGURE', 'AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED', 'Enable Deprecated MOUNT_CONFIGURE message', 0, "MOUNT"), # noqa Feature('MAVLink', 'AP_MAVLINK_BATTERY2_ENABLED', 'AP_MAVLINK_BATTERY2_ENABLED', 'Enable Send old BATTERY2 message', 0, None), # noqa Feature('MAVLink', 'MAV_DEVICE_OP', 'AP_MAVLINK_MSG_DEVICE_OP_ENABLED', 'Enable DeviceOp MAVLink messages', 0, None), # noqa Feature('MAVLink', 'MAV_SERVO_RELAY', 'AP_MAVLINK_SERVO_RELAY_ENABLED', 'Enable ServoRelay MAVLink messages', 0, 'SERVORELAY_EVENTS'), # noqa diff --git a/Tools/scripts/extract_features.py b/Tools/scripts/extract_features.py index 4224f2de4b4d49..e37f206df0493c 100755 --- a/Tools/scripts/extract_features.py +++ b/Tools/scripts/extract_features.py @@ -248,8 +248,6 @@ def __init__(self, filename, nm="arm-none-eabi-nm", strings="strings"): ('AP_MAVLINK_MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES_ENABLED', 'GCS_MAVLINK::handle_command_request_autopilot_capabilities'), # noqa ('AP_MAVLINK_MSG_RELAY_STATUS_ENABLED', 'GCS_MAVLINK::send_relay_status'), ('AP_MAVLINK_BATTERY2_ENABLED', 'GCS_MAVLINK::send_battery2'), - ('AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED', 'AP_Mount::handle_mount_control'), - ('AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED', 'AP_Mount::handle_mount_configure'), ('AP_MAVLINK_MSG_DEVICE_OP_ENABLED', 'GCS_MAVLINK::handle_device_op_write'), ('AP_MAVLINK_SERVO_RELAY_ENABLED', 'GCS_MAVLINK::handle_servorelay_message'), ('AP_MAVLINK_MSG_SERIAL_CONTROL_ENABLED', 'GCS_MAVLINK::handle_serial_control'), diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index 0b64b1063bb0e2..d28b11f49e3f5d 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -574,40 +574,6 @@ void AP_Mount::handle_global_position_int(const mavlink_message_t &msg) } } -#if AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED -/// Change the configuration of the mount -void AP_Mount::handle_mount_configure(const mavlink_message_t &msg) -{ - auto *backend = get_primary(); - if (backend == nullptr) { - return; - } - - mavlink_mount_configure_t packet; - mavlink_msg_mount_configure_decode(&msg, &packet); - - // send message to backend - backend->handle_mount_configure(packet); -} -#endif - -#if AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED -/// Control the mount (depends on the previously set mount configuration) -void AP_Mount::handle_mount_control(const mavlink_message_t &msg) -{ - auto *backend = get_primary(); - if (backend == nullptr) { - return; - } - - mavlink_mount_control_t packet; - mavlink_msg_mount_control_decode(&msg, &packet); - - // send message to backend - backend->handle_mount_control(packet); -} -#endif - #if HAL_GCS_ENABLED // send a GIMBAL_DEVICE_ATTITUDE_STATUS message to GCS void AP_Mount::send_gimbal_device_attitude_status(mavlink_channel_t chan) @@ -988,16 +954,6 @@ void AP_Mount::handle_message(mavlink_channel_t chan, const mavlink_message_t &m case MAVLINK_MSG_ID_GIMBAL_REPORT: handle_gimbal_report(chan, msg); break; -#if AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED - case MAVLINK_MSG_ID_MOUNT_CONFIGURE: - handle_mount_configure(msg); - break; -#endif -#if AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED - case MAVLINK_MSG_ID_MOUNT_CONTROL: - handle_mount_control(msg); - break; -#endif case MAVLINK_MSG_ID_GLOBAL_POSITION_INT: handle_global_position_int(msg); break; diff --git a/libraries/AP_Mount/AP_Mount.h b/libraries/AP_Mount/AP_Mount.h index d34f5816368938..7b4b9ec5091f37 100644 --- a/libraries/AP_Mount/AP_Mount.h +++ b/libraries/AP_Mount/AP_Mount.h @@ -316,12 +316,6 @@ class AP_Mount AP_Mount_Backend *get_instance(uint8_t instance) const; void handle_gimbal_report(mavlink_channel_t chan, const mavlink_message_t &msg); -#if AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED - void handle_mount_configure(const mavlink_message_t &msg); -#endif -#if AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED - void handle_mount_control(const mavlink_message_t &msg); -#endif MAV_RESULT handle_command_do_mount_configure(const mavlink_command_int_t &packet); MAV_RESULT handle_command_do_mount_control(const mavlink_command_int_t &packet); diff --git a/libraries/AP_Mount/AP_Mount_Backend.cpp b/libraries/AP_Mount/AP_Mount_Backend.cpp index 531d01c30a6e36..71a581b288c6bd 100644 --- a/libraries/AP_Mount/AP_Mount_Backend.cpp +++ b/libraries/AP_Mount/AP_Mount_Backend.cpp @@ -189,14 +189,6 @@ void AP_Mount_Backend::set_target_sysid(uint8_t sysid) } } -#if AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED -// process MOUNT_CONFIGURE messages received from GCS. deprecated. -void AP_Mount_Backend::handle_mount_configure(const mavlink_mount_configure_t &packet) -{ - set_mode((MAV_MOUNT_MODE)packet.mount_mode); -} -#endif - #if HAL_GCS_ENABLED // send a GIMBAL_DEVICE_ATTITUDE_STATUS message to GCS void AP_Mount_Backend::send_gimbal_device_attitude_status(mavlink_channel_t chan) @@ -299,44 +291,6 @@ void AP_Mount_Backend::send_gimbal_manager_status(mavlink_channel_t chan) 0); // secondary control component id } -#if AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED -// process MOUNT_CONTROL messages received from GCS. deprecated. -void AP_Mount_Backend::handle_mount_control(const mavlink_mount_control_t &packet) -{ - switch (get_mode()) { - case MAV_MOUNT_MODE_MAVLINK_TARGETING: - // input_a : Pitch in centi-degrees (earth-frame) - // input_b : Roll in centi-degrees (earth-frame) - // input_c : Yaw in centi-degrees (interpreted as body-frame) - set_angle_target(packet.input_b * 0.01, packet.input_a * 0.01, packet.input_c * 0.01, false); - break; - - case MAV_MOUNT_MODE_GPS_POINT: { - // input_a : lat in degE7 - // input_b : lon in degE7 - // input_c : alt in cm (interpreted as above home) - const Location target_location { - packet.input_a, - packet.input_b, - packet.input_c, - Location::AltFrame::ABOVE_HOME - }; - set_roi_target(target_location); - break; - } - - case MAV_MOUNT_MODE_RETRACT: - case MAV_MOUNT_MODE_NEUTRAL: - case MAV_MOUNT_MODE_RC_TARGETING: - case MAV_MOUNT_MODE_SYSID_TARGET: - case MAV_MOUNT_MODE_HOME_LOCATION: - default: - // no effect in these modes - break; - } -} -#endif - // handle do_mount_control command. Returns MAV_RESULT_ACCEPTED on success MAV_RESULT AP_Mount_Backend::handle_command_do_mount_control(const mavlink_command_int_t &packet) { diff --git a/libraries/AP_Mount/AP_Mount_Backend.h b/libraries/AP_Mount/AP_Mount_Backend.h index 62b46e0c4e275b..8628694e82929a 100644 --- a/libraries/AP_Mount/AP_Mount_Backend.h +++ b/libraries/AP_Mount/AP_Mount_Backend.h @@ -107,16 +107,6 @@ class AP_Mount_Backend // requires original message in order to extract caller's sysid and compid MAV_RESULT handle_command_do_gimbal_manager_configure(const mavlink_command_int_t &packet, const mavlink_message_t &msg); -#if AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED - // process MOUNT_CONFIGURE messages received from GCS. deprecated. - void handle_mount_configure(const mavlink_mount_configure_t &msg); -#endif - -#if AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED - // process MOUNT_CONTROL messages received from GCS. deprecated. - void handle_mount_control(const mavlink_mount_control_t &packet); -#endif - // send a GIMBAL_DEVICE_ATTITUDE_STATUS message to GCS void send_gimbal_device_attitude_status(mavlink_channel_t chan); diff --git a/libraries/GCS_MAVLink/GCS_Common.cpp b/libraries/GCS_MAVLink/GCS_Common.cpp index 8fb6bc3f8f40b7..83eb282ac0274f 100644 --- a/libraries/GCS_MAVLink/GCS_Common.cpp +++ b/libraries/GCS_MAVLink/GCS_Common.cpp @@ -4284,18 +4284,6 @@ void GCS_MAVLINK::handle_message(const mavlink_message_t &msg) #endif #if HAL_MOUNT_ENABLED -#if AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED - case MAVLINK_MSG_ID_MOUNT_CONFIGURE: // deprecated. Use MAV_CMD_DO_MOUNT_CONFIGURE - send_received_message_deprecation_warning("MOUNT_CONFIGURE"); - handle_mount_message(msg); - break; -#endif -#if AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED - case MAVLINK_MSG_ID_MOUNT_CONTROL: // deprecated. Use MAV_CMD_DO_MOUNT_CONTROL - send_received_message_deprecation_warning("MOUNT_CONTROL"); - handle_mount_message(msg); - break; -#endif case MAVLINK_MSG_ID_GIMBAL_REPORT: case MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION: case MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS: diff --git a/libraries/GCS_MAVLink/GCS_config.h b/libraries/GCS_MAVLink/GCS_config.h index 8a297bb003f1ec..24ea13a942dbb0 100644 --- a/libraries/GCS_MAVLink/GCS_config.h +++ b/libraries/GCS_MAVLink/GCS_config.h @@ -71,18 +71,6 @@ #define AP_MAVLINK_RALLY_POINT_PROTOCOL_ENABLED 0 #endif -// CODE_REMOVAL -// ArduPilot 4.5 sends deprecation warnings for MOUNT_CONTROL/MOUNT_CONFIGURE -// ArduPilot 4.6 stops compiling them in -// ArduPilot 4.7 removes the code entirely -#ifndef AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED -#define AP_MAVLINK_MSG_MOUNT_CONFIGURE_ENABLED 0 -#endif - -#ifndef AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED -#define AP_MAVLINK_MSG_MOUNT_CONTROL_ENABLED 0 -#endif - // this is for both read and write messages: #ifndef AP_MAVLINK_MSG_DEVICE_OP_ENABLED #define AP_MAVLINK_MSG_DEVICE_OP_ENABLED HAL_GCS_ENABLED