mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 16:43:34 +08:00
manual_control: add selector class [WIP]
This adds a selector class with unit tests. The idea is to have a valid flag in manual_control_septoint and set that according to the selection and/or timeout of manual_control_inputs.
This commit is contained in:
committed by
Matthias Grob
parent
eeb7682fd9
commit
723db8bf2a
@@ -46,6 +46,7 @@
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/SubscriptionCallback.hpp>
|
||||
#include "ManualControlSelector.hpp"
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
@@ -92,15 +93,12 @@ private:
|
||||
{this, ORB_ID(manual_control_input), 2},
|
||||
};
|
||||
|
||||
manual_control_input_s _manual_control_input[MAX_MANUAL_INPUT_COUNT] {};
|
||||
|
||||
bool _available[MAX_MANUAL_INPUT_COUNT] {};
|
||||
|
||||
int8_t _selected_manual_input{-1};
|
||||
|
||||
systemlib::Hysteresis _stick_arm_hysteresis{false};
|
||||
systemlib::Hysteresis _stick_disarm_hysteresis{false};
|
||||
|
||||
ManualControlSelector _selector;
|
||||
bool _published_invalid_once{false};
|
||||
|
||||
perf_counter_t _loop_perf{perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")};
|
||||
perf_counter_t _loop_interval_perf{perf_alloc(PC_INTERVAL, MODULE_NAME": interval")};
|
||||
|
||||
@@ -112,4 +110,4 @@ private:
|
||||
(ParamInt<px4::params::COM_RC_ARM_HYST>) _param_rc_arm_hyst
|
||||
)
|
||||
};
|
||||
}; // namespace manual_control
|
||||
} // namespace manual_control
|
||||
|
||||
Reference in New Issue
Block a user