From 7fd157acb4fbd56e86180a23818d88518b0d192f Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 14 Aug 2021 21:41:33 +0100 Subject: [PATCH] Rover: move AIS to vehicle This reverts most of commit e86665a989e2d4fa35b79231a04a9310a5800e6c. --- Rover/GCS_Mavlink.cpp | 7 ------- Rover/Parameters.cpp | 17 +++++++++-------- Rover/Parameters.h | 5 ----- Rover/Rover.cpp | 3 --- Rover/system.cpp | 4 ---- Rover/wscript | 1 - 6 files changed, 9 insertions(+), 28 deletions(-) diff --git a/Rover/GCS_Mavlink.cpp b/Rover/GCS_Mavlink.cpp index 589ed63951..a16a252542 100644 --- a/Rover/GCS_Mavlink.cpp +++ b/Rover/GCS_Mavlink.cpp @@ -388,13 +388,6 @@ bool GCS_MAVLINK_Rover::try_send_message(enum ap_message id) break; } - case MSG_AIS_VESSEL: { -#if HAL_AIS_ENABLED - rover.g2.ais.send(chan); -#endif - break; - } - default: return GCS_MAVLINK::try_send_message(id); } diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 47d3f0727d..66e83c9bd9 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -650,12 +650,6 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { AP_SUBGROUPINFO(torqeedo, "TRQD_", 49, ParametersG2, AP_Torqeedo), #endif -#if HAL_AIS_ENABLED - // @Group: AIS_ - // @Path: ../libraries/AP_AIS/AP_AIS.cpp - AP_SUBGROUPINFO(ais, "AIS_", 50, ParametersG2, AP_AIS), -#endif - // @Group: PSC // @Path: ../libraries/APM_Control/AR_PosControl.cpp AP_SUBGROUPINFO(pos_control, "PSC", 51, ParametersG2, AR_PosControl), @@ -852,16 +846,23 @@ void Rover::load_parameters(void) AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_ARMED); #endif -// PARAMETER_CONVERSION - Added: JAN-2022 -#if AP_AIRSPEED_ENABLED +#if AP_AIRSPEED_ENABLED | AP_AIS_ENABLED // Find G2's Top Level Key AP_Param::ConversionInfo info; if (!AP_Param::find_top_level_key_by_pointer(&g2, info.old_key)) { return; } +#endif +// PARAMETER_CONVERSION - Added: JAN-2022 +#if AP_AIRSPEED_ENABLED const uint16_t old_index = 37; // Old parameter index in the tree const uint16_t old_top_element = 4069; // Old group element in the tree for the first subgroup element AP_Param::convert_class(info.old_key, &airspeed, airspeed.var_info, old_index, old_top_element, false); #endif + +// PARAMETER_CONVERSION - Added: MAR-2022 +#if AP_AIS_ENABLED + AP_Param::convert_class(info.old_key, &ais, ais.var_info, 50, 114, false); +#endif } diff --git a/Rover/Parameters.h b/Rover/Parameters.h index 756ca70f47..89b506fc99 100644 --- a/Rover/Parameters.h +++ b/Rover/Parameters.h @@ -415,11 +415,6 @@ public: AP_Torqeedo torqeedo; #endif -#if HAL_AIS_ENABLED - // Automatic Identification System - for tracking sea-going vehicles - AP_AIS ais; -#endif - // position controller AR_PosControl pos_control; diff --git a/Rover/Rover.cpp b/Rover/Rover.cpp index b20d644c1e..c8d656752a 100644 --- a/Rover/Rover.cpp +++ b/Rover/Rover.cpp @@ -130,9 +130,6 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = { #if ADVANCED_FAILSAFE == ENABLED SCHED_TASK(afs_fs_check, 10, 200, 129), #endif -#if HAL_AIS_ENABLED - SCHED_TASK_CLASS(AP_AIS, &rover.g2.ais, update, 5, 100, 135), -#endif }; diff --git a/Rover/system.cpp b/Rover/system.cpp index 4d08c33797..709911dc53 100644 --- a/Rover/system.cpp +++ b/Rover/system.cpp @@ -58,10 +58,6 @@ void Rover::init_ardupilot() log_init(); #endif -#if HAL_AIS_ENABLED - g2.ais.init(); -#endif - // initialise compass AP::compass().set_log_bit(MASK_LOG_COMPASS); AP::compass().init(); diff --git a/Rover/wscript b/Rover/wscript index ba0dbe1e9f..980299e852 100644 --- a/Rover/wscript +++ b/Rover/wscript @@ -26,7 +26,6 @@ def build(bld): 'AP_WindVane', 'AR_Motors', 'AP_Torqeedo', - 'AP_AIS', ], )