mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
RC_Channel: Add soaring aux function.
This commit is contained in:
parent
d8f2d0cf8d
commit
455ebaadf2
@ -96,6 +96,27 @@ void RC_Channel_Plane::do_aux_function_crow_mode(AuxSwitchPos ch_flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RC_Channel_Plane::do_aux_function_soaring_3pos(AuxSwitchPos ch_flag)
|
||||||
|
{
|
||||||
|
#if SOARING_ENABLED == ENABLED
|
||||||
|
SoaringController::ActiveStatus desired_state = SoaringController::ActiveStatus::SOARING_DISABLED;
|
||||||
|
|
||||||
|
switch (ch_flag) {
|
||||||
|
case AuxSwitchPos::LOW:
|
||||||
|
desired_state = SoaringController::ActiveStatus::SOARING_DISABLED;
|
||||||
|
break;
|
||||||
|
case AuxSwitchPos::MIDDLE:
|
||||||
|
desired_state = SoaringController::ActiveStatus::MANUAL_MODE_CHANGE;
|
||||||
|
break;
|
||||||
|
case AuxSwitchPos::HIGH:
|
||||||
|
desired_state = SoaringController::ActiveStatus::AUTO_MODE_CHANGE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
plane.g2.soaring_controller.set_pilot_desired_state(desired_state);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void RC_Channel_Plane::init_aux_function(const RC_Channel::aux_func_t ch_option,
|
void RC_Channel_Plane::init_aux_function(const RC_Channel::aux_func_t ch_option,
|
||||||
const RC_Channel::AuxSwitchPos ch_flag)
|
const RC_Channel::AuxSwitchPos ch_flag)
|
||||||
{
|
{
|
||||||
@ -184,6 +205,10 @@ void RC_Channel_Plane::do_aux_function(const aux_func_t ch_option, const AuxSwit
|
|||||||
do_aux_function_change_mode(Mode::Number::TAKEOFF, ch_flag);
|
do_aux_function_change_mode(Mode::Number::TAKEOFF, ch_flag);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AUX_FUNC::SOARING:
|
||||||
|
do_aux_function_soaring_3pos(ch_flag);
|
||||||
|
break;
|
||||||
|
|
||||||
case AUX_FUNC::FLAP:
|
case AUX_FUNC::FLAP:
|
||||||
break; // flap input label, nothing to do
|
break; // flap input label, nothing to do
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ private:
|
|||||||
void do_aux_function_q_assist_state(AuxSwitchPos ch_flag);
|
void do_aux_function_q_assist_state(AuxSwitchPos ch_flag);
|
||||||
|
|
||||||
void do_aux_function_crow_mode(AuxSwitchPos ch_flag);
|
void do_aux_function_crow_mode(AuxSwitchPos ch_flag);
|
||||||
|
|
||||||
|
void do_aux_function_soaring_3pos(AuxSwitchPos ch_flag);
|
||||||
};
|
};
|
||||||
|
|
||||||
class RC_Channels_Plane : public RC_Channels
|
class RC_Channels_Plane : public RC_Channels
|
||||||
|
@ -185,6 +185,7 @@ public:
|
|||||||
GENERATOR = 85, // generator control
|
GENERATOR = 85, // generator control
|
||||||
TER_DISABLE = 86, // disable terrain following in CRUISE/FBWB modes
|
TER_DISABLE = 86, // disable terrain following in CRUISE/FBWB modes
|
||||||
CROW_SELECT = 87, // select CROW mode for diff spoilers;high disables,mid forces progressive
|
CROW_SELECT = 87, // select CROW mode for diff spoilers;high disables,mid forces progressive
|
||||||
|
SOARING = 88, // three-position switch to set soaring mode
|
||||||
|
|
||||||
// entries from 100 onwards are expected to be developer
|
// entries from 100 onwards are expected to be developer
|
||||||
// options used for testing
|
// options used for testing
|
||||||
|
Loading…
Reference in New Issue
Block a user