Copter: auto stays in takeoff submode after reaching altitude

This commit is contained in:
Randy Mackay 2019-11-11 20:32:43 +09:00 committed by Andrew Tridgell
parent 35a51968c1
commit 93d8a57edc
1 changed files with 1 additions and 5 deletions

View File

@ -370,7 +370,7 @@ bool ModeAuto::is_landing() const
bool ModeAuto::is_taking_off() const
{
return _mode == Auto_TakeOff;
return ((_mode == Auto_TakeOff) && !wp_nav->reached_wp_destination());
}
bool ModeAuto::landing_gear_should_be_deployed() const
@ -741,10 +741,6 @@ bool ModeAuto::verify_command(const AP_Mission::Mission_Command& cmd)
void ModeAuto::takeoff_run()
{
auto_takeoff_run();
if (wp_nav->reached_wp_destination()) {
const Vector3f target = wp_nav->get_wp_destination();
wp_start(target, wp_nav->origin_and_destination_are_terrain_alt());
}
}
// auto_wp_run - runs the auto waypoint controller