forked from Archive/PX4-Autopilot
Hotfix: Check all channel mappings for valid ranges
This commit is contained in:
parent
14bbecfd7a
commit
e1356f69b4
|
@ -1405,26 +1405,6 @@ Sensors::rc_poll()
|
|||
manual_control.yaw *= _parameters.rc_scale_yaw;
|
||||
}
|
||||
|
||||
/* mode switch input */
|
||||
if (_rc.function[MODE] >= 0) {
|
||||
manual_control.mode_switch = limit_minus_one_to_one(_rc.chan[_rc.function[MODE]].scaled);
|
||||
}
|
||||
|
||||
/* land switch input */
|
||||
if (_rc.function[MODE] >= 0) {
|
||||
manual_control.return_switch = limit_minus_one_to_one(_rc.chan[_rc.function[RETURN]].scaled);
|
||||
}
|
||||
|
||||
/* assisted switch input */
|
||||
if (_rc.function[MODE] >= 0) {
|
||||
manual_control.assisted_switch = limit_minus_one_to_one(_rc.chan[_rc.function[ASSISTED]].scaled);
|
||||
}
|
||||
|
||||
/* mission switch input */
|
||||
if (_rc.function[MODE] >= 0) {
|
||||
manual_control.mission_switch = limit_minus_one_to_one(_rc.chan[_rc.function[MISSION]].scaled);
|
||||
}
|
||||
|
||||
/* flaps */
|
||||
if (_rc.function[FLAPS] >= 0) {
|
||||
|
||||
|
@ -1443,6 +1423,16 @@ Sensors::rc_poll()
|
|||
manual_control.mission_switch = limit_minus_one_to_one(_rc.chan[_rc.function[MISSION]].scaled);
|
||||
}
|
||||
|
||||
/* land switch input */
|
||||
if (_rc.function[RETURN] >= 0) {
|
||||
manual_control.return_switch = limit_minus_one_to_one(_rc.chan[_rc.function[RETURN]].scaled);
|
||||
}
|
||||
|
||||
/* assisted switch input */
|
||||
if (_rc.function[ASSISTED] >= 0) {
|
||||
manual_control.assisted_switch = limit_minus_one_to_one(_rc.chan[_rc.function[ASSISTED]].scaled);
|
||||
}
|
||||
|
||||
// if (_rc.function[OFFBOARD_MODE] >= 0) {
|
||||
// manual_control.auto_offboard_input_switch = limit_minus_one_to_one(_rc.chan[_rc.function[OFFBOARD_MODE]].scaled);
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue