mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 18:11:35 +08:00
gps failure has priority over engine falure, in case both fail make sure
that the gps failure mode does not turn on the engine
This commit is contained in:
@@ -511,10 +511,10 @@ bool set_nav_state(struct vehicle_status_s *status, const bool data_link_loss_en
|
|||||||
} else if (status->rc_signal_lost_cmd) {
|
} else if (status->rc_signal_lost_cmd) {
|
||||||
status->nav_state = NAVIGATION_STATE_AUTO_RTGS; //XXX
|
status->nav_state = NAVIGATION_STATE_AUTO_RTGS; //XXX
|
||||||
/* Finished handling commands which have priority , now handle failures */
|
/* Finished handling commands which have priority , now handle failures */
|
||||||
} else if (status->engine_failure) {
|
|
||||||
status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL;
|
|
||||||
} else if (status->gps_failure) {
|
} else if (status->gps_failure) {
|
||||||
status->nav_state = NAVIGATION_STATE_AUTO_LANDGPSFAIL;
|
status->nav_state = NAVIGATION_STATE_AUTO_LANDGPSFAIL;
|
||||||
|
} else if (status->engine_failure) {
|
||||||
|
status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL;
|
||||||
} else if (((status->data_link_lost && data_link_loss_enabled) && status->rc_signal_lost) ||
|
} else if (((status->data_link_lost && data_link_loss_enabled) && status->rc_signal_lost) ||
|
||||||
(!data_link_loss_enabled && status->rc_signal_lost && mission_finished)) {
|
(!data_link_loss_enabled && status->rc_signal_lost && mission_finished)) {
|
||||||
status->failsafe = true;
|
status->failsafe = true;
|
||||||
|
|||||||
@@ -860,8 +860,12 @@ FixedwingAttitudeControl::task_main()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* throttle passed through */
|
/* throttle passed through if it is finite and if no engine failure was
|
||||||
_actuators.control[3] = (isfinite(throttle_sp)) ? throttle_sp : 0.0f;
|
* detected */
|
||||||
|
_actuators.control[3] = (isfinite(throttle_sp) &&
|
||||||
|
!(_vehicle_status.engine_failure ||
|
||||||
|
_vehicle_status.engine_failure_cmd)) ?
|
||||||
|
throttle_sp : 0.0f;
|
||||||
if (!isfinite(throttle_sp)) {
|
if (!isfinite(throttle_sp)) {
|
||||||
if (_debug && loop_counter % 10 == 0) {
|
if (_debug && loop_counter % 10 == 0) {
|
||||||
warnx("throttle_sp %.4f", (double)throttle_sp);
|
warnx("throttle_sp %.4f", (double)throttle_sp);
|
||||||
|
|||||||
Reference in New Issue
Block a user