Skip to content

Commit

Permalink
Sub: remove redundant home-setting sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Feb 14, 2019
1 parent 13db459 commit db362ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
8 changes: 0 additions & 8 deletions ArduSub/GCS_Mavlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions ArduSub/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit db362ea

Please sign in to comment.