Rover: fix RTL when AP_RALLY disabled
This commit is contained in:
parent
dd3163b065
commit
03e0437c19
@ -398,7 +398,6 @@ public:
|
||||
protected:
|
||||
|
||||
bool _enter() override;
|
||||
Location return_target;
|
||||
};
|
||||
|
||||
class ModeSmartRTL : public Mode
|
||||
|
@ -10,9 +10,15 @@ bool ModeRTL::_enter()
|
||||
|
||||
// initialise waypoint speed
|
||||
set_desired_speed_to_default(true);
|
||||
return_target = rover.g2.rally.calc_best_rally_or_home_location(rover.current_loc, ahrs.get_home().alt);
|
||||
|
||||
// set target to the closest rally point or home
|
||||
#if AP_RALLY == ENABLED
|
||||
set_desired_location(rover.g2.rally.calc_best_rally_or_home_location(rover.current_loc, ahrs.get_home().alt));
|
||||
#else
|
||||
// set destination
|
||||
set_desired_location(return_target);
|
||||
set_desired_location(rover.home);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user