diff --git a/ArduPlane/GCS_Mavlink.cpp b/ArduPlane/GCS_Mavlink.cpp index b805612991..22b84518fd 100644 --- a/ArduPlane/GCS_Mavlink.cpp +++ b/ArduPlane/GCS_Mavlink.cpp @@ -711,7 +711,7 @@ void GCS_MAVLINK_Plane::packetReceived(const mavlink_status_t &status, #if HAL_ADSB_ENABLED plane.avoidance_adsb.handle_msg(msg); #endif -#if AP_SCRIPTING_ENABLED +#if AP_SCRIPTING_ENABLED && AP_FOLLOW_ENABLED // pass message to follow library plane.g2.follow.handle_msg(msg); #endif @@ -963,7 +963,7 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_packet(const mavlink_command_in case MAV_CMD_GUIDED_CHANGE_HEADING: return handle_command_int_guided_slew_commands(packet); -#if AP_SCRIPTING_ENABLED +#if AP_SCRIPTING_ENABLED && AP_FOLLOW_ENABLED case MAV_CMD_DO_FOLLOW: // param1: sysid of target to follow if ((packet.param1 > 0) && (packet.param1 <= 255)) { diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index 8695703102..687a99072d 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -1235,7 +1235,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { // @Bitmask: 0: Servo 1, 1: Servo 2, 2: Servo 3, 3: Servo 4, 4: Servo 5, 5: Servo 6, 6: Servo 7, 7: Servo 8, 8: Servo 9, 9: Servo 10, 10: Servo 11, 11: Servo 12, 12: Servo 13, 13: Servo 14, 14: Servo 15 AP_GROUPINFO("ONESHOT_MASK", 32, ParametersG2, oneshot_mask, 0), -#if AP_SCRIPTING_ENABLED +#if AP_SCRIPTING_ENABLED && AP_FOLLOW_ENABLED // @Group: FOLL // @Path: ../libraries/AP_Follow/AP_Follow.cpp AP_SUBGROUPINFO(follow, "FOLL", 33, ParametersG2, AP_Follow), diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index 45382c31d5..058c1a4987 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -550,7 +550,7 @@ public: AC_PID guidedHeading{5000.0, 0.0, 0.0, 0 , 10.0, 5.0, 5.0 , 5.0 , 0.2}; #endif -#if AP_SCRIPTING_ENABLED +#if AP_SCRIPTING_ENABLED && AP_FOLLOW_ENABLED AP_Follow follow; #endif