mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
ArduCopter: bug fix to LAND flight mode not actually landing if initiated from failsafe
An hidden bit of failsafe functionality in the set_mode function was switching the throttle mode back to THROTTLE_AUTO instead of THROTTLE_LAND
This commit is contained in:
parent
a18892229c
commit
05e59f6f4d
@ -408,8 +408,8 @@ static void set_mode(byte mode)
|
|||||||
|
|
||||||
// used to stop fly_aways
|
// used to stop fly_aways
|
||||||
// set to false if we have low throttle
|
// set to false if we have low throttle
|
||||||
motors.auto_armed(g.rc_3.control_in > 0);
|
motors.auto_armed(g.rc_3.control_in > 0 || ap.failsafe);
|
||||||
set_auto_armed(g.rc_3.control_in > 0);
|
set_auto_armed(g.rc_3.control_in > 0 || ap.failsafe);
|
||||||
|
|
||||||
// if we change modes, we must clear landed flag
|
// if we change modes, we must clear landed flag
|
||||||
set_land_complete(false);
|
set_land_complete(false);
|
||||||
@ -570,17 +570,6 @@ static void set_mode(byte mode)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ap.failsafe) {
|
|
||||||
// this is to allow us to fly home without interactive throttle control
|
|
||||||
set_throttle_mode(THROTTLE_AUTO);
|
|
||||||
ap.manual_throttle = false;
|
|
||||||
|
|
||||||
// does not wait for us to be in high throttle, since the
|
|
||||||
// Receiver will be outputting low throttle
|
|
||||||
motors.auto_armed(true);
|
|
||||||
set_auto_armed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ap.manual_attitude) {
|
if(ap.manual_attitude) {
|
||||||
// We are under manual attitude control
|
// We are under manual attitude control
|
||||||
// remove the navigation from roll and pitch command
|
// remove the navigation from roll and pitch command
|
||||||
|
Loading…
Reference in New Issue
Block a user