Copter: Allow manual autorotations without enabling arot flight mode
This commit is contained in:
parent
b2d2bf61da
commit
9269ee50ed
@ -193,17 +193,21 @@ void Copter::heli_update_rotor_speed_targets()
|
|||||||
void Copter::heli_update_autorotation()
|
void Copter::heli_update_autorotation()
|
||||||
{
|
{
|
||||||
#if MODE_AUTOROTATE_ENABLED == ENABLED
|
#if MODE_AUTOROTATE_ENABLED == ENABLED
|
||||||
//set autonomous autorotation flight mode
|
// check if flying and interlock disengaged
|
||||||
if (!ap.land_complete && !motors->get_interlock() && !flightmode->has_manual_throttle() && g2.arot.is_enable()) {
|
if (!ap.land_complete && !motors->get_interlock()) {
|
||||||
|
if (!flightmode->has_manual_throttle() && g2.arot.is_enable()) {
|
||||||
|
// set autonomous autorotation flight mode
|
||||||
|
set_mode(Mode::Number::AUTOROTATE, ModeReason::AUTOROTATION_START);
|
||||||
|
}
|
||||||
|
// set flag to facilitate both auto and manual autorotations
|
||||||
heli_flags.in_autorotation = true;
|
heli_flags.in_autorotation = true;
|
||||||
set_mode(Mode::Number::AUTOROTATE, ModeReason::AUTOROTATION_START);
|
|
||||||
} else {
|
} else {
|
||||||
heli_flags.in_autorotation = false;
|
heli_flags.in_autorotation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sets autorotation flags through out libraries
|
// sets autorotation flags through out libraries
|
||||||
heli_set_autorotation(heli_flags.in_autorotation);
|
heli_set_autorotation(heli_flags.in_autorotation);
|
||||||
if (!ap.land_complete && g2.arot.is_enable()) {
|
if (!ap.land_complete) {
|
||||||
motors->set_enable_bailout(true);
|
motors->set_enable_bailout(true);
|
||||||
} else {
|
} else {
|
||||||
motors->set_enable_bailout(false);
|
motors->set_enable_bailout(false);
|
||||||
@ -215,7 +219,7 @@ void Copter::heli_update_autorotation()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if MODE_AUTOROTATE_ENABLED == ENABLED
|
#if MODE_AUTOROTATE_ENABLED == ENABLED
|
||||||
// heli_set_autorotation - set the autorotation f`lag throughout libraries
|
// heli_set_autorotation - set the autorotation flag throughout libraries
|
||||||
void Copter::heli_set_autorotation(bool autorotation)
|
void Copter::heli_set_autorotation(bool autorotation)
|
||||||
{
|
{
|
||||||
motors->set_in_autorotation(autorotation);
|
motors->set_in_autorotation(autorotation);
|
||||||
|
Loading…
Reference in New Issue
Block a user