From 20461b9ea3db71b7beffcc795407f1e17f2aa0c6 Mon Sep 17 00:00:00 2001 From: Rustom Jehangir Date: Sat, 20 Feb 2016 18:16:23 -0800 Subject: [PATCH] Sub: Remove ADSB support --- ArduSub/APM_Config.h | 1 - ArduSub/ArduSub.cpp | 3 -- ArduSub/GCS_Mavlink.cpp | 3 -- ArduSub/Parameters.cpp | 2 +- ArduSub/Sub.h | 5 ---- ArduSub/adsb.cpp | 62 ----------------------------------------- ArduSub/config.h | 6 ---- ArduSub/make.inc | 1 - ArduSub/wscript | 1 - 9 files changed, 1 insertion(+), 83 deletions(-) delete mode 100644 ArduSub/adsb.cpp diff --git a/ArduSub/APM_Config.h b/ArduSub/APM_Config.h index 3de20b3924..dd39642d98 100644 --- a/ArduSub/APM_Config.h +++ b/ArduSub/APM_Config.h @@ -36,7 +36,6 @@ //#define NAV_GUIDED DISABLED // disable external navigation computer ability to control vehicle through MAV_CMD_NAV_GUIDED mission commands //#define OPTFLOW DISABLED // disable optical flow sensor to save 5K of flash space //#define FRSKY_TELEM_ENABLED DISABLED // disable FRSky telemetry -#define ADSB_ENABLED DISABLED // disable ADSB support // features below are disabled by default on all boards //#define SPRAYER ENABLED // enable the crop sprayer feature (two ESC controlled pumps the speed of which depends upon the vehicle's horizontal velocity) diff --git a/ArduSub/ArduSub.cpp b/ArduSub/ArduSub.cpp index dd53bb5bb5..5cea5adbb2 100644 --- a/ArduSub/ArduSub.cpp +++ b/ArduSub/ArduSub.cpp @@ -137,9 +137,6 @@ const AP_Scheduler::Task Sub::scheduler_tasks[] = { SCHED_TASK(rpm_update, 10, 200), SCHED_TASK(compass_cal_update, 100, 100), SCHED_TASK(accel_cal_update, 10, 100), -#if ADSB_ENABLED == ENABLED - SCHED_TASK(adsb_update, 1, 100), -#endif #if FRSKY_TELEM_ENABLED == ENABLED SCHED_TASK(frsky_telemetry_send, 5, 75), #endif diff --git a/ArduSub/GCS_Mavlink.cpp b/ArduSub/GCS_Mavlink.cpp index 5ba93d45a4..32da20cc0b 100644 --- a/ArduSub/GCS_Mavlink.cpp +++ b/ArduSub/GCS_Mavlink.cpp @@ -1987,9 +1987,6 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) } case MAVLINK_MSG_ID_ADSB_VEHICLE: -#if ADSB_ENABLED == ENABLED - sub.adsb.update_vehicle(msg); -#endif break; } // end switch diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index e518ae7d21..10f229a901 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -1098,7 +1098,7 @@ const AP_Param::Info Sub::var_info[] = { // @Group: ADSB_ // @Path: ../libraries/AP_ADSB/AP_ADSB.cpp - GOBJECT(adsb, "ADSB_", AP_ADSB), + // GOBJECT(adsb, "ADSB_", AP_ADSB), // @Param: AUTOTUNE_AXES // @DisplayName: Autotune axis bitmask diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index df80024536..e5b3ab37f5 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -90,7 +90,6 @@ #include #include // Landing Gear library #include -#include #include #include // Pilot input handling library #include // Heli specific pilot input handling library @@ -518,8 +517,6 @@ private: AC_InputManager_Heli input_manager; #endif - AP_ADSB adsb {ahrs}; - // use this to prevent recursion during sensor init bool in_mavlink_delay; @@ -746,8 +743,6 @@ private: void autotune_updating_p_up(float &tune_p, float tune_p_max, float tune_p_step_ratio, float target, float measurement_max); void autotune_updating_p_up_d_down(float &tune_d, float tune_d_min, float tune_d_step_ratio, float &tune_p, float tune_p_min, float tune_p_max, float tune_p_step_ratio, float target, float measurement_min, float measurement_max); void autotune_twitching_measure_acceleration(float &rate_of_change, float rate_measurement, float &rate_measurement_max); - void adsb_update(void); - void adsb_handle_vehicle_threats(void); bool brake_init(bool ignore_checks); void brake_run(); bool circle_init(bool ignore_checks); diff --git a/ArduSub/adsb.cpp b/ArduSub/adsb.cpp deleted file mode 100644 index 6edc533701..0000000000 --- a/ArduSub/adsb.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -/* - * adsb.cpp - * Copyright (C) Tom Pittenger 2015 - * - * This file is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "Sub.h" - -#if ADSB_ENABLED == ENABLED - -/* - * this module deals with ADS-B handling for ArduPilot - * ADS-B is an RF based collision avoidance protocol to tell nearby aircraft your location - * https://en.wikipedia.org/wiki/Automatic_dependent_surveillance_%E2%80%93_broadcast - * - */ - -/* - handle periodic adsb database maintenance and handle threats - */ -void Sub::adsb_update(void) -{ - adsb.update(); - adsb_handle_vehicle_threats(); -} - -/* - * Handle ADS-B based threats which are platform dependent - */ -void Sub::adsb_handle_vehicle_threats(void) -{ - // handle clearing of threat - if (adsb.get_is_evading_threat() && !adsb.get_another_vehicle_within_radius()) { - adsb.set_is_evading_threat(false); - Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_ADSB, ERROR_CODE_FAILSAFE_RESOLVED); - gcs_send_text(MAV_SEVERITY_CRITICAL, "ADS-B threat cleared"); - return; - } - - // handle new threat - if (!adsb.get_is_evading_threat() && adsb.get_another_vehicle_within_radius()) { - adsb.set_is_evading_threat(true); - Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_ADSB, ERROR_CODE_FAILSAFE_OCCURRED); - gcs_send_text(MAV_SEVERITY_CRITICAL, "ADS-B threat!"); - return; - } -} - -#endif // #ADSB_ENABLED diff --git a/ArduSub/config.h b/ArduSub/config.h index 37f9ea721c..573faf4b3b 100644 --- a/ArduSub/config.h +++ b/ArduSub/config.h @@ -326,12 +326,6 @@ # define PARACHUTE ENABLED #endif -////////////////////////////////////////////////////////////////////////////// -// ADSB support -#ifndef ADSB_ENABLED -# define ADSB_ENABLED ENABLED -#endif - ////////////////////////////////////////////////////////////////////////////// // Nav-Guided - allows external nav computer to control vehicle #ifndef NAV_GUIDED diff --git a/ArduSub/make.inc b/ArduSub/make.inc index 4d0cb8eafd..000263874a 100644 --- a/ArduSub/make.inc +++ b/ArduSub/make.inc @@ -58,4 +58,3 @@ LIBRARIES += AP_RPM LIBRARIES += AC_PrecLand LIBRARIES += AP_IRLock LIBRARIES += AC_InputManager -LIBRARIES += AP_ADSB diff --git a/ArduSub/wscript b/ArduSub/wscript index de2c3e0066..dd3503fd52 100644 --- a/ArduSub/wscript +++ b/ArduSub/wscript @@ -7,7 +7,6 @@ def build(bld): name=vehicle + '_libs', vehicle=vehicle, libraries=bld.ap_common_vehicle_libraries() + [ - 'AP_ADSB', 'AC_AttitudeControl', 'AC_Fence', 'AC_PID',