mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 12:11:36 +08:00
new manual_control_switches msg (split out of manual_control_setpoint) (#16270)
- split out switches from manual_control_setpoint into new message manual_control_switches
- manual_control_switches published at minimal rate (~ 1 Hz) or immediately on change
- simple switch debounce in rc_update (2 consecutive identical decodes required)
- manual_control_switches logged at full rate rather than sampled at (5-10% of messages logged)
- manual_control_setpoint publish at minimal rate unless changing
- commander handle landing gear switch for manual modes
- processing of mode_slot and mode_switch is now split so we only do one or the other (not both)
- a future step will be to finally drop mode_switch and accompanying switches entirely
Co-authored-by: Matthias Grob <maetugr@gmail.com>
This commit is contained in:
co-authored by
Matthias Grob
parent
25ef76b3b8
commit
ef6209ba03
@@ -198,9 +198,9 @@ VtolAttitudeControl::is_fixed_wing_requested()
|
||||
{
|
||||
bool to_fw = false;
|
||||
|
||||
if (_manual_control_setpoint.transition_switch != manual_control_setpoint_s::SWITCH_POS_NONE &&
|
||||
if (_manual_control_switches.transition_switch != manual_control_switches_s::SWITCH_POS_NONE &&
|
||||
_v_control_mode.flag_control_manual_enabled) {
|
||||
to_fw = (_manual_control_setpoint.transition_switch == manual_control_setpoint_s::SWITCH_POS_ON);
|
||||
to_fw = (_manual_control_switches.transition_switch == manual_control_switches_s::SWITCH_POS_ON);
|
||||
|
||||
} else {
|
||||
// listen to transition commands if not in manual or mode switch is not mapped
|
||||
@@ -403,7 +403,7 @@ VtolAttitudeControl::Run()
|
||||
}
|
||||
|
||||
_v_control_mode_sub.update(&_v_control_mode);
|
||||
_manual_control_setpoint_sub.update(&_manual_control_setpoint);
|
||||
_manual_control_switches_sub.update(&_manual_control_switches);
|
||||
_v_att_sub.update(&_v_att);
|
||||
_local_pos_sub.update(&_local_pos);
|
||||
_local_pos_sp_sub.update(&_local_pos_sp);
|
||||
|
||||
Reference in New Issue
Block a user