mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 01:43:34 +08:00
Fix enum for COM_RC_IN_MODE in failsafe
add enum RcInMode Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
This commit is contained in:
committed by
Beat Küng
parent
8fe65c6722
commit
957a06a780
@@ -354,7 +354,7 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
|
||||
const bool rc_loss_ignored = rc_loss_ignored_mission || rc_loss_ignored_loiter || rc_loss_ignored_offboard ||
|
||||
rc_loss_ignored_takeoff || ignore_link_failsafe || _manual_control_lost_at_arming;
|
||||
|
||||
if (_param_com_rc_in_mode.get() != int32_t(offboard_loss_failsafe_mode::Land_mode) && !rc_loss_ignored) {
|
||||
if (_param_com_rc_in_mode.get() != int32_t(RcInMode::StickInputDisabled) && !rc_loss_ignored) {
|
||||
CHECK_FAILSAFE(status_flags, manual_control_signal_lost,
|
||||
fromNavDllOrRclActParam(_param_nav_rcl_act.get()).causedBy(Cause::ManualControlLoss));
|
||||
}
|
||||
@@ -382,7 +382,7 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
|
||||
|
||||
// If manual control loss and GCS connection loss are disabled and we lose both command links and the mission finished,
|
||||
// trigger RTL to avoid losing the vehicle
|
||||
if ((_param_com_rc_in_mode.get() == int32_t(offboard_loss_failsafe_mode::Land_mode) || rc_loss_ignored_mission)
|
||||
if ((_param_com_rc_in_mode.get() == int32_t(RcInMode::StickInputDisabled) || rc_loss_ignored_mission)
|
||||
&& _param_nav_dll_act.get() == int32_t(gcs_connection_loss_failsafe_mode::Disabled)
|
||||
&& state.mission_finished) {
|
||||
_last_state_mission_control_lost = checkFailsafe(_caller_id_mission_control_lost, _last_state_mission_control_lost,
|
||||
|
||||
@@ -123,6 +123,15 @@ private:
|
||||
Hold_mode = 2,
|
||||
};
|
||||
|
||||
// COM_RC_IN_MODE parameter values
|
||||
enum class RcInMode : int32_t {
|
||||
RcTransmitterOnly = 0, // RC Transmitter only
|
||||
JoystickOnly = 1, // Joystick only
|
||||
RcAndJoystickWithFallback = 2, // RC And Joystick with fallback
|
||||
RcOrJoystickKeepFirst = 3, // RC or Joystick keep first
|
||||
StickInputDisabled = 4 // input disabled
|
||||
};
|
||||
|
||||
static ActionOptions fromNavDllOrRclActParam(int param_value);
|
||||
|
||||
static ActionOptions fromGfActParam(int param_value);
|
||||
|
||||
Reference in New Issue
Block a user