Plane: mode_qloiter: combine enter and init

This commit is contained in:
Iampete1 2021-09-04 20:21:04 +01:00 committed by Andrew Tridgell
parent 70d9d20faf
commit fa908b0a1d

View File

@ -2,11 +2,6 @@
#include "Plane.h"
bool ModeQLoiter::_enter()
{
return plane.mode_qstabilize._enter();
}
void ModeQLoiter::init()
{
// initialise loiter
loiter_nav->clear_pilot_desired_acceleration();
@ -23,6 +18,7 @@ void ModeQLoiter::init()
// prevent re-init of target position
quadplane.last_loiter_ms = AP_HAL::millis();
return true;
}
void ModeQLoiter::update()
@ -43,7 +39,7 @@ void ModeQLoiter::run()
return;
}
if (!quadplane.motors->armed()) {
plane.mode_qloiter.init();
plane.mode_qloiter._enter();
}
quadplane.check_attitude_relax();