mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 06:00:36 +08:00
Mantis: add RC hacks
This changes the way RC is handled for the Mantis: - The RC values are re-written when arriving over MAVLink. They are rescaled from 0..4095 to 1000..2000 and the channel bits added to separate channels. This makes the downstream handling easier. - Gimbal pitch is moved from Aux1 to Aux2 as that should be the default. - Aux3 and Aux4 are used for the photo and video trigger. - The speed button is used as the FLTMODE channel and set to switch between POSCTL and ALTCTL.
This commit is contained in:
@@ -638,6 +638,11 @@ void RCUpdate::UpdateManualSwitches(const hrt_abstime ×tamp_sample)
|
||||
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());
|
||||
|
||||
#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);
|
||||
#endif
|
||||
|
||||
// last 2 switch updates identical (simple protection from bad RC data)
|
||||
if (switches == _manual_switches_previous) {
|
||||
const bool switches_changed = (switches != _manual_switches_last_publish);
|
||||
|
||||
Reference in New Issue
Block a user