diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 34f393b740..7a4d0e312e 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -1,5 +1,7 @@ #include "Rover.h" +#include + /* Rover parameter definitions */ @@ -580,11 +582,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { // @User: Standard AP_GROUPINFO("MIS_DONE_BEHAVE", 38, ParametersG2, mis_done_behave, 0), -#if AP_GRIPPER_ENABLED - // @Group: GRIP_ - // @Path: ../libraries/AP_Gripper/AP_Gripper.cpp - AP_SUBGROUPINFO(gripper, "GRIP_", 39, ParametersG2, AP_Gripper), -#endif + // 39 was AP_Gripper // @Param: BAL_PITCH_TRIM // @DisplayName: Balance Bot pitch trim angle @@ -923,6 +921,21 @@ void Rover::load_parameters(void) } #endif + // PARAMETER_CONVERSION - Added: Feb-2024 for Copter-4.6 +#if AP_GRIPPER_ENABLED + { + // Find G2's Top Level Key + AP_Param::ConversionInfo gripper_info; + if (!AP_Param::find_top_level_key_by_pointer(&g2, gripper_info.old_key)) { + return; + } + + const uint16_t gripper_old_index = 39; // Old parameter index in g2 + const uint16_t gripper_old_top_element = 4071; // Old group element in the tree for the first subgroup element (see AP_PARAM_KEY_DUMP) + AP_Param::convert_class(gripper_info.old_key, &gripper, gripper.var_info, gripper_old_index, gripper_old_top_element, false); + } +#endif + // PARAMETER_CONVERSION - Added: Feb-2024 for Rover-4.6 #if HAL_LOGGING_ENABLED AP_Param::convert_class(g.k_param_logger, &logger, logger.var_info, 0, 0, true); diff --git a/Rover/Parameters.h b/Rover/Parameters.h index ef8d619470..19067a2c4b 100644 --- a/Rover/Parameters.h +++ b/Rover/Parameters.h @@ -8,7 +8,6 @@ #include #include #include -#include "AP_Gripper/AP_Gripper.h" #include #include "AP_Rally.h" #include @@ -372,10 +371,6 @@ public: AC_Sprayer sprayer; #endif -#if AP_GRIPPER_ENABLED - AP_Gripper gripper; -#endif - #if HAL_RALLY_ENABLED // Rally point library AP_Rally_Rover rally; diff --git a/Rover/Rover.cpp b/Rover/Rover.cpp index b956267eef..f1a47b4525 100644 --- a/Rover/Rover.cpp +++ b/Rover/Rover.cpp @@ -35,8 +35,6 @@ #include "version.h" #undef FORCE_VERSION_H_INCLUDE -#include "AP_Gripper/AP_Gripper.h" - const AP_HAL::HAL& hal = AP_HAL::get_HAL(); #define SCHED_TASK(func, _interval_ticks, _max_time_micros, _priority) SCHED_TASK_CLASS(Rover, &rover, func, _interval_ticks, _max_time_micros, _priority) @@ -101,9 +99,6 @@ const AP_Scheduler::Task Rover::scheduler_tasks[] = { #if AP_SERVORELAYEVENTS_ENABLED SCHED_TASK_CLASS(AP_ServoRelayEvents, &rover.ServoRelayEvents, update_events, 50, 200, 66), #endif -#if AP_GRIPPER_ENABLED - SCHED_TASK_CLASS(AP_Gripper, &rover.g2.gripper, update, 10, 75, 69), -#endif #if AC_PRECLAND_ENABLED SCHED_TASK(update_precland, 400, 50, 70), #endif diff --git a/Rover/system.cpp b/Rover/system.cpp index 35e76c4d47..1c1354dd80 100644 --- a/Rover/system.cpp +++ b/Rover/system.cpp @@ -14,11 +14,6 @@ static void failsafe_check_static() void Rover::init_ardupilot() { - // init gripper -#if AP_GRIPPER_ENABLED - g2.gripper.init(); -#endif - // initialise notify system notify.init(); notify_mode(control_mode);