From db362eaa138a76955f371694c9f4f0c22acba8f0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 13 Feb 2019 13:47:06 +1100 Subject: [PATCH] Sub: remove redundant home-setting sanity checks --- ArduSub/GCS_Mavlink.cpp | 8 -------- ArduSub/commands.cpp | 5 ----- 2 files changed, 13 deletions(-) diff --git a/ArduSub/GCS_Mavlink.cpp b/ArduSub/GCS_Mavlink.cpp index abca6bd455..db440ffa9c 100644 --- a/ArduSub/GCS_Mavlink.cpp +++ b/ArduSub/GCS_Mavlink.cpp @@ -681,10 +681,6 @@ MAV_RESULT GCS_MAVLINK_Sub::handle_command_long_packet(const mavlink_command_lon if (!is_zero(packet.param1)) { return MAV_RESULT_FAILED; } - // sanity check location - if (!check_latlng(packet.param5, packet.param6)) { - return MAV_RESULT_FAILED; - } Location new_home_loc; new_home_loc.lat = (int32_t)(packet.param5 * 1.0e7f); new_home_loc.lng = (int32_t)(packet.param6 * 1.0e7f); @@ -949,10 +945,6 @@ void GCS_MAVLINK_Sub::handleMessage(mavlink_message_t* msg) // ignore this failure } } else { - // sanity check location - if (!check_latlng(packet.latitude, packet.longitude)) { - break; - } Location new_home_loc; new_home_loc.lat = packet.latitude; new_home_loc.lng = packet.longitude; diff --git a/ArduSub/commands.cpp b/ArduSub/commands.cpp index f77af7ba51..659ccd3b73 100644 --- a/ArduSub/commands.cpp +++ b/ArduSub/commands.cpp @@ -55,11 +55,6 @@ bool Sub::set_home_to_current_location(bool lock) // returns true if home location set successfully bool Sub::set_home(const Location& loc, bool lock) { - // check location is valid - if (loc.lat == 0 && loc.lng == 0) { - return false; - } - // check if EKF origin has been set Location ekf_origin; if (!ahrs.get_origin(ekf_origin)) {