Skip to content

Commit

Permalink
ArduSub: remove far_from_EKF_origin sanity checks
Browse files Browse the repository at this point in the history
some  flawed implementations, and the extreme-ardupilot project means these checks are no longer required
  • Loading branch information
peterbarker committed Apr 9, 2024
1 parent 2f71a40 commit 6b90dc5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
1 change: 0 additions & 1 deletion ArduSub/Sub.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ class Sub : public AP_Vehicle {
void set_home_to_current_location_inflight();
bool set_home_to_current_location(bool lock) override WARN_IF_UNUSED;
bool set_home(const Location& loc, bool lock) override WARN_IF_UNUSED;
bool far_from_EKF_origin(const Location& loc);
float get_alt_rel() const WARN_IF_UNUSED;
float get_alt_msl() const WARN_IF_UNUSED;
void exit_mission();
Expand Down
9 changes: 0 additions & 9 deletions ArduSub/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,3 @@ bool Sub::set_home(const Location& loc, bool lock)
// return success
return true;
}

// far_from_EKF_origin - checks if a location is too far from the EKF origin
// returns true if too far
bool Sub::far_from_EKF_origin(const Location& loc)
{
// check distance to EKF origin
Location ekf_origin;
return ahrs.get_origin(ekf_origin) && (ekf_origin.get_distance(loc) > EKF_ORIGIN_MAX_DIST_M);
}
6 changes: 2 additions & 4 deletions ArduSub/commands_logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,8 @@ void Sub::do_set_home(const AP_Mission::Mission_Command& cmd)
// silently ignore this failure
}
} else {
if (!far_from_EKF_origin(cmd.content.location)) {
if (!set_home(cmd.content.location, false)) {
// silently ignore this failure
}
if (!set_home(cmd.content.location, false)) {
// silently ignore this failure
}
}
}
Expand Down

0 comments on commit 6b90dc5

Please sign in to comment.