Skip to content

Commit

Permalink
Rover: provide and use base class set_home_from_current_location
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Apr 10, 2024
1 parent 553c8ba commit 3073ea4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Rover/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
// set ahrs home to current location from inertial-nav location
bool Rover::set_home_to_current_location(bool lock)
{
Location temp_loc;
if (ahrs.have_inertial_nav() && ahrs.get_location(temp_loc)) {
if (!set_home(temp_loc, lock)) {
return false;
}
// we have successfully set AHRS home, set it for SmartRTL
g2.smart_rtl.set_home(true);
return true;
if (!AP_Vehicle::set_home_to_current_location(lock)) {
return false;
}
return false;

// we have successfully set AHRS home, set it for SmartRTL
g2.smart_rtl.set_home(true);

return true;
}

// sets ahrs home to specified location
Expand Down

0 comments on commit 3073ea4

Please sign in to comment.