mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-11 11:33:35 +08:00
Failsafe: descend on joint global position invalid and RC loss
This commit is contained in:
@@ -547,6 +547,13 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
|
||||
if (state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION ||
|
||||
state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER) {
|
||||
CHECK_FAILSAFE(status_flags, position_accuracy_low, fromPosLowActParam(_param_com_pos_low_act.get()));
|
||||
|
||||
// Joint invalid global position and RC loss failsafe
|
||||
_last_state_joint_pos_rcl_loss = checkFailsafe(_caller_id_joint_pos_rcl_loss, _last_state_joint_pos_rcl_loss,
|
||||
status_flags.global_position_invalid && status_flags.manual_control_signal_lost,
|
||||
Action::Descend);
|
||||
// To do it immediately regardless of COM_FAIL_ACT_T, replace Action::Descend by:
|
||||
// ActionOptions(Action::Descend).cannotBeDeferred()
|
||||
}
|
||||
|
||||
if (state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF ||
|
||||
|
||||
@@ -186,6 +186,8 @@ private:
|
||||
bool _last_state_fd_esc_arming{false};
|
||||
const int _caller_id_battery_unhealthy_spoolup{genCallerId()};
|
||||
bool _last_state_battery_unhealthy_spoolup{false};
|
||||
const int _caller_id_joint_pos_rcl_loss{genCallerId()};
|
||||
bool _last_state_joint_pos_rcl_loss{false};
|
||||
|
||||
hrt_abstime _armed_time{0};
|
||||
bool _was_armed{false};
|
||||
|
||||
Reference in New Issue
Block a user