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:
Julian Oes
2021-10-05 14:32:46 +02:00
committed by Daniel Agar
parent 9fe7a40673
commit e4763f15f6
4 changed files with 39 additions and 37 deletions
+5
View File
@@ -638,6 +638,11 @@ void RCUpdate::UpdateManualSwitches(const hrt_abstime &timestamp_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);