mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 21:53:33 +08:00
commander: add wind or flight time limit exceeded mode requirement
This prevents switching into any of these modes once the condition is set.
This commit is contained in:
@@ -393,8 +393,7 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state,
|
||||
|
||||
CHECK_FAILSAFE(status_flags, wind_limit_exceeded,
|
||||
ActionOptions(Action::RTL).clearOn(ClearCondition::OnModeChangeOrDisarm));
|
||||
CHECK_FAILSAFE(status_flags, flight_time_limit_exceeded,
|
||||
ActionOptions(Action::RTL).allowUserTakeover(UserTakeoverAllowed::Never));
|
||||
CHECK_FAILSAFE(status_flags, flight_time_limit_exceeded, ActionOptions(Action::RTL));
|
||||
|
||||
CHECK_FAILSAFE(status_flags, primary_geofence_breached, fromGfActParam(_param_gf_action.get()));
|
||||
|
||||
|
||||
@@ -614,6 +614,7 @@ uint8_t FailsafeBase::modeFromAction(const Action &action, uint8_t user_intended
|
||||
bool FailsafeBase::modeCanRun(const failsafe_flags_s &status_flags, uint8_t mode)
|
||||
{
|
||||
uint32_t mode_mask = 1u << mode;
|
||||
// mode_req_wind_and_flight_time_compliance: does not need to be handled here (these are separate failsafe triggers)
|
||||
return
|
||||
(!status_flags.angular_velocity_invalid || ((status_flags.mode_req_angular_velocity & mode_mask) == 0)) &&
|
||||
(!status_flags.attitude_invalid || ((status_flags.mode_req_attitude & mode_mask) == 0)) &&
|
||||
|
||||
Reference in New Issue
Block a user