Skip to content
Snippets Groups Projects
Commit e70223c2 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Allow transition commands also in manual if no switch is used

parent 1f1839d9
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ VtolAttitudeControl::VtolAttitudeControl() :
_vtol_vehicle_status_pub(nullptr),
_v_rates_sp_pub(nullptr),
_v_att_sp_pub(nullptr),
_transition_command(vtol_vehicle_status_s::VEHICLE_VTOL_STATE_MC),
_abort_front_transition(false)
{
......@@ -481,11 +481,15 @@ VtolAttitudeControl::handle_command()
bool
VtolAttitudeControl::is_fixed_wing_requested()
{
bool to_fw = _manual_control_sp.transition_switch == manual_control_setpoint_s::SWITCH_POS_ON;
bool to_fw = false;
if (_manual_control_sp.transition_switch != manual_control_setpoint_s::SWITCH_POS_NONE &&
_v_control_mode.flag_control_manual_enabled) {
to_fw = (_manual_control_sp.transition_switch == manual_control_setpoint_s::SWITCH_POS_ON);
// listen to transition commands if not in manual
if (!_v_control_mode.flag_control_manual_enabled) {
to_fw = _transition_command == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW;
} else {
// listen to transition commands if not in manual or mode switch is not mapped
to_fw = (_transition_command == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW);
}
// handle abort request
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment