mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
commander arming_state_transition: respect fRunPreArmChecks properly
if fRunPreArmChecks was set to false, there were still cases where the preflight checks could be called. This fixes that. arming_state_transition() with fRunPreArmChecks=false is only called when entering & leaving preflight calibration mode. All other places use fRunPreArmChecks=true, which means there is no change for these.
This commit is contained in:
@@ -137,8 +137,9 @@ transition_result_t arming_state_transition(vehicle_status_s *status, const batt
|
|||||||
|
|
||||||
/* re-run the pre-flight check as long as sensors are failing */
|
/* re-run the pre-flight check as long as sensors are failing */
|
||||||
if (!status_flags->condition_system_sensors_initialized
|
if (!status_flags->condition_system_sensors_initialized
|
||||||
&& ((new_arming_state == vehicle_status_s::ARMING_STATE_ARMED) || (new_arming_state == vehicle_status_s::ARMING_STATE_STANDBY))
|
&& fRunPreArmChecks
|
||||||
&& !hil_enabled) {
|
&& ((new_arming_state == vehicle_status_s::ARMING_STATE_ARMED) || (new_arming_state == vehicle_status_s::ARMING_STATE_STANDBY))
|
||||||
|
&& !hil_enabled) {
|
||||||
|
|
||||||
if ((last_preflight_check == 0) || (hrt_elapsed_time(&last_preflight_check) > 1000 * 1000)) {
|
if ((last_preflight_check == 0) || (hrt_elapsed_time(&last_preflight_check) > 1000 * 1000)) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user