helicopter: add switch to engage main motor

For helicopters it's useful (e.g. during bringup) to be able to disable
the main rotor while the tail is still controlled to safely land.
This commit is contained in:
Beat Küng
2022-08-16 17:32:57 +02:00
parent f32d931117
commit 7e75b497ae
7 changed files with 70 additions and 17 deletions
+6 -2
View File
@@ -56,7 +56,8 @@ static bool operator ==(const manual_control_switches_s &a, const manual_control
a.transition_switch == b.transition_switch &&
a.gear_switch == b.gear_switch &&
a.photo_switch == b.photo_switch &&
a.video_switch == b.video_switch);
a.video_switch == b.video_switch &&
a.engage_main_motor_switch == b.engage_main_motor_switch);
}
static bool operator !=(const manual_control_switches_s &a, const manual_control_switches_s &b) { return !(a == b); }
@@ -231,6 +232,8 @@ void RCUpdate::update_rc_functions()
_rc.function[rc_channels_s::FUNCTION_PARAM_1 + i] = _parameters.rc_map_param[i] - 1;
}
_rc.function[rc_channels_s::FUNCTION_ENGAGE_MAIN_MOTOR] = _param_rc_map_eng_mot.get() - 1;
map_flight_modes_buttons();
}
@@ -643,7 +646,8 @@ void RCUpdate::UpdateManualSwitches(const hrt_abstime &timestamp_sample)
switches.arm_switch = get_rc_sw2pos_position(rc_channels_s::FUNCTION_ARMSWITCH, _param_rc_armswitch_th.get());
switches.transition_switch = get_rc_sw2pos_position(rc_channels_s::FUNCTION_TRANSITION, _param_rc_trans_th.get());
switches.gear_switch = get_rc_sw2pos_position(rc_channels_s::FUNCTION_GEAR, _param_rc_gear_th.get());
switches.engage_main_motor_switch = get_rc_sw2pos_position(rc_channels_s::FUNCTION_ENGAGE_MAIN_MOTOR,
_param_rc_eng_mot_th.get());
#if defined(ATL_MANTIS_RC_INPUT_HACKS)
switches.photo_switch = get_rc_sw2pos_position(rc_channels_s::FUNCTION_AUX_3, 0.5f);
switches.video_switch = get_rc_sw2pos_position(rc_channels_s::FUNCTION_AUX_4, 0.5f);