Skip to content

Commit 1250d3f

Browse files
committed
Rover: provide and use base class set_home_from_current_location
1 parent 059c39a commit 1250d3f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Rover/commands.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
// set ahrs home to current location from inertial-nav location
44
bool Rover::set_home_to_current_location(bool lock)
55
{
6-
Location temp_loc;
7-
if (ahrs.have_inertial_nav() && ahrs.get_location(temp_loc)) {
8-
if (!set_home(temp_loc, lock)) {
9-
return false;
10-
}
11-
// we have successfully set AHRS home, set it for SmartRTL
12-
g2.smart_rtl.set_home(true);
13-
return true;
6+
if (!AP_Vehicle::set_home_to_current_location(lock)) {
7+
return false;
148
}
15-
return false;
9+
10+
// we have successfully set AHRS home, set it for SmartRTL
11+
g2.smart_rtl.set_home(true);
12+
13+
return true;
1614
}
1715

1816
// sets ahrs home to specified location

0 commit comments

Comments
 (0)