ArduSub: add AP_GRIPPER_ENABLED

This commit is contained in:
Peter Barker 2022-09-20 17:37:48 +10:00 committed by Andrew Tridgell
parent 9e0894c93a
commit 82ddfc2a52
6 changed files with 6 additions and 11 deletions

View File

@ -99,7 +99,7 @@ const AP_Scheduler::Task Sub::scheduler_tasks[] = {
SCHED_TASK_CLASS(AP_RPM, &sub.rpm_sensor, update, 10, 200, 66), SCHED_TASK_CLASS(AP_RPM, &sub.rpm_sensor, update, 10, 200, 66),
#endif #endif
SCHED_TASK(terrain_update, 10, 100, 72), SCHED_TASK(terrain_update, 10, 100, 72),
#if GRIPPER_ENABLED == ENABLED #if AP_GRIPPER_ENABLED
SCHED_TASK_CLASS(AP_Gripper, &sub.g2.gripper, update, 10, 75, 75), SCHED_TASK_CLASS(AP_Gripper, &sub.g2.gripper, update, 10, 75, 75),
#endif #endif
#ifdef USERHOOK_FASTLOOP #ifdef USERHOOK_FASTLOOP

View File

@ -631,7 +631,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
AP_SUBGROUPINFO(proximity, "PRX", 2, ParametersG2, AP_Proximity), AP_SUBGROUPINFO(proximity, "PRX", 2, ParametersG2, AP_Proximity),
#endif #endif
#if GRIPPER_ENABLED == ENABLED #if AP_GRIPPER_ENABLED
// @Group: GRIP_ // @Group: GRIP_
// @Path: ../libraries/AP_Gripper/AP_Gripper.cpp // @Path: ../libraries/AP_Gripper/AP_Gripper.cpp
AP_SUBGROUPINFO(gripper, "GRIP_", 3, ParametersG2, AP_Gripper), AP_SUBGROUPINFO(gripper, "GRIP_", 3, ParametersG2, AP_Gripper),

View File

@ -320,7 +320,7 @@ public:
// var_info for holding Parameter information // var_info for holding Parameter information
static const struct AP_Param::GroupInfo var_info[]; static const struct AP_Param::GroupInfo var_info[];
#if GRIPPER_ENABLED #if AP_GRIPPER_ENABLED
AP_Gripper gripper; AP_Gripper gripper;
#endif #endif

View File

@ -87,7 +87,8 @@
#include <AP_RPM/AP_RPM.h> #include <AP_RPM/AP_RPM.h>
#endif #endif
#if GRIPPER_ENABLED == ENABLED #include <AP_Gripper/AP_Gripper_config.h>
#if AP_GRIPPER_ENABLED
#include <AP_Gripper/AP_Gripper.h> // gripper stuff #include <AP_Gripper/AP_Gripper.h> // gripper stuff
#endif #endif

View File

@ -91,12 +91,6 @@
# define EKF_ORIGIN_MAX_DIST_M 50000 // EKF origin and waypoints (including home) must be within 50km # define EKF_ORIGIN_MAX_DIST_M 50000 // EKF origin and waypoints (including home) must be within 50km
#endif #endif
//////////////////////////////////////////////////////////////////////////////
// gripper
#ifndef GRIPPER_ENABLED
# define GRIPPER_ENABLED DISABLED
#endif
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// Nav-Guided - allows external nav computer to control vehicle // Nav-Guided - allows external nav computer to control vehicle
#ifndef NAV_GUIDED #ifndef NAV_GUIDED

View File

@ -20,7 +20,7 @@ void Sub::init_ardupilot()
#endif #endif
// init cargo gripper // init cargo gripper
#if GRIPPER_ENABLED == ENABLED #if AP_GRIPPER_ENABLED
g2.gripper.init(); g2.gripper.init();
#endif #endif