Rover: use sanitize method rather than location_sanitize function

This commit is contained in:
Peter Barker 2019-03-27 11:34:07 +11:00 committed by Andrew Tridgell
parent e6a8e337c7
commit dabf92f5b6

View File

@ -251,7 +251,7 @@ void ModeAuto::start_guided(const Location& loc)
// sanity check target location
if ((loc.lat != 0) || (loc.lng != 0)) {
guided_target.loc = loc;
location_sanitize(rover.current_loc, guided_target.loc);
guided_target.loc.sanitize(rover.current_loc);
guided_target.valid = true;
} else {
guided_target.valid = false;
@ -499,7 +499,7 @@ void ModeAuto::do_nav_wp(const AP_Mission::Mission_Command& cmd, bool always_sto
// retrieve and sanitize target location
Location cmdloc = cmd.content.location;
location_sanitize(rover.current_loc, cmdloc);
cmdloc.sanitize(rover.current_loc);
set_desired_location(cmdloc, next_leg_bearing_cd);
}