@ -201,7 +201,7 @@ bool AP_Arming::barometer_checks(bool report)
@@ -201,7 +201,7 @@ bool AP_Arming::barometer_checks(bool report)
if ( ( checks_to_perform & ARMING_CHECK_ALL ) | |
( checks_to_perform & ARMING_CHECK_BARO ) ) {
if ( ! AP : : baro ( ) . all_healthy ( ) ) {
check_failed ( ARMING_CHECK_BARO , report , " Barometer not healthy " ) ;
check_failed ( ARMING_CHECK_BARO , report , " 气压计不健康 " ) ; //Barometer not healthy
return false ;
}
}
@ -220,7 +220,7 @@ bool AP_Arming::airspeed_checks(bool report)
@@ -220,7 +220,7 @@ bool AP_Arming::airspeed_checks(bool report)
}
for ( uint8_t i = 0 ; i < AIRSPEED_MAX_SENSORS ; i + + ) {
if ( airspeed - > enabled ( i ) & & airspeed - > use ( i ) & & ! airspeed - > healthy ( i ) ) {
check_failed ( ARMING_CHECK_AIRSPEED , report , " Airspeed %d not healthy " , i + 1 ) ;
check_failed ( ARMING_CHECK_AIRSPEED , report , " 空速计 %d 不健康 " , i + 1 ) ; //Airspeed %d not healthy
return false ;
}
}
@ -238,11 +238,11 @@ bool AP_Arming::logging_checks(bool report)
@@ -238,11 +238,11 @@ bool AP_Arming::logging_checks(bool report)
return true ;
}
if ( AP : : logger ( ) . logging_failed ( ) ) {
check_failed ( ARMING_CHECK_LOGGING , report , " Logging failed " ) ;
check_failed ( ARMING_CHECK_LOGGING , report , " 日志记录错误 " ) ; //Logging failed
return false ;
}
if ( ! AP : : logger ( ) . CardInserted ( ) ) {
check_failed ( ARMING_CHECK_LOGGING , report , " No SD card " ) ;
check_failed ( ARMING_CHECK_LOGGING , report , " 无SD卡 " ) ; //No SD card
return false ;
}
}
@ -325,37 +325,37 @@ bool AP_Arming::ins_checks(bool report)
@@ -325,37 +325,37 @@ bool AP_Arming::ins_checks(bool report)
( checks_to_perform & ARMING_CHECK_INS ) ) {
const AP_InertialSensor & ins = AP : : ins ( ) ;
if ( ! ins . get_gyro_health_all ( ) ) {
check_failed ( ARMING_CHECK_INS , report , " Gyros not healthy " ) ;
check_failed ( ARMING_CHECK_INS , report , " 陀螺仪不健康 " ) ; //Gyros not healthy
return false ;
}
if ( ! ins . gyro_calibrated_ok_all ( ) ) {
check_failed ( ARMING_CHECK_INS , report , " Gyros not calibrated " ) ;
check_failed ( ARMING_CHECK_INS , report , " 陀螺仪需要校准 " ) ; //Gyros not calibrated
return false ;
}
if ( ! ins . get_accel_health_all ( ) ) {
check_failed ( ARMING_CHECK_INS , report , " Accels not healthy " ) ;
check_failed ( ARMING_CHECK_INS , report , " 加速度计不健康 " ) ; //Accels not healthy
return false ;
}
if ( ! ins . accel_calibrated_ok_all ( ) ) {
check_failed ( ARMING_CHECK_INS , report , " 3D Accel calibration needed " ) ;
check_failed ( ARMING_CHECK_INS , report , " 3D加速度计需要校准 " ) ; //3D Accel calibration needed
return false ;
}
//check if accelerometers have calibrated and require reboot
if ( ins . accel_cal_requires_reboot ( ) ) {
check_failed ( ARMING_CHECK_INS , report , " Accels calibrated requires reboot " ) ;
check_failed ( ARMING_CHECK_INS , report , " 加速度计校准后需重启 " ) ; //Accels calibrated requires reboot
return false ;
}
// check all accelerometers point in roughly same direction
if ( ! ins_accels_consistent ( ins ) ) {
check_failed ( ARMING_CHECK_INS , report , " Accels inconsistent " ) ;
check_failed ( ARMING_CHECK_INS , report , " 加速度计值不一致 " ) ; //Accels inconsistent
return false ;
}
// check all gyros are giving consistent readings
if ( ! ins_gyros_consistent ( ins ) ) {
check_failed ( ARMING_CHECK_INS , report , " Gyros inconsistent " ) ;
check_failed ( ARMING_CHECK_INS , report , " 陀螺仪值不一致 " ) ; //Gyros inconsistent
return false ;
}
@ -376,13 +376,13 @@ bool AP_Arming::compass_checks(bool report)
@@ -376,13 +376,13 @@ bool AP_Arming::compass_checks(bool report)
// check if compass is calibrating
if ( _compass . is_calibrating ( ) ) {
check_failed ( report , " Compass calibration running " ) ;
check_failed ( report , " 正在校准指南针.... " ) ; //Compass calibration running
return false ;
}
// check if compass has calibrated and requires reboot
if ( _compass . compass_cal_requires_reboot ( ) ) {
check_failed ( report , " Compass calibrated requires reboot " ) ;
check_failed ( report , " 指南针校准后需重启 " ) ; //Compass calibrated requires reboot
return false ;
}
@ -397,32 +397,32 @@ bool AP_Arming::compass_checks(bool report)
@@ -397,32 +397,32 @@ bool AP_Arming::compass_checks(bool report)
}
if ( ! _compass . healthy ( ) ) {
check_failed ( ARMING_CHECK_COMPASS , report , " Compass not healthy " ) ;
check_failed ( ARMING_CHECK_COMPASS , report , " 指南针不健康 " ) ; //Compass not healthy
return false ;
}
// check compass learning is on or offsets have been set
if ( ! _compass . learn_offsets_enabled ( ) & & ! _compass . configured ( ) ) {
check_failed ( ARMING_CHECK_COMPASS , report , " Compass not calibrated " ) ;
check_failed ( ARMING_CHECK_COMPASS , report , " 指南针需要校准 " ) ; //Compass not calibrated
return false ;
}
// check for unreasonable compass offsets
const Vector3f offsets = _compass . get_offsets ( ) ;
if ( offsets . length ( ) > _compass . get_offsets_max ( ) ) {
check_failed ( ARMING_CHECK_COMPASS , report , " Compass offsets too high " ) ;
check_failed ( ARMING_CHECK_COMPASS , report , " 指南针偏移过大 " ) ; //Compass offsets too high
return false ;
}
// check for unreasonable mag field length
const float mag_field = _compass . get_field ( ) . length ( ) ;
if ( mag_field > AP_ARMING_COMPASS_MAGFIELD_MAX | | mag_field < AP_ARMING_COMPASS_MAGFIELD_MIN ) {
check_failed ( ARMING_CHECK_COMPASS , report , " Check mag field " ) ;
check_failed ( ARMING_CHECK_COMPASS , report , " 磁力计检查错误 " ) ; //Check mag field
return false ;
}
// check all compasses point in roughly same direction
if ( ! _compass . consistent ( ) ) {
check_failed ( ARMING_CHECK_COMPASS , report , " Compasses inconsistent " ) ;
check_failed ( ARMING_CHECK_COMPASS , report , " 指南针不一致 " ) ; //Compasses inconsistent
return false ;
}
}
@ -438,25 +438,25 @@ bool AP_Arming::gps_checks(bool report)
@@ -438,25 +438,25 @@ bool AP_Arming::gps_checks(bool report)
//GPS OK?
if ( ! AP : : ahrs ( ) . home_is_set ( ) | |
gps . status ( ) < AP_GPS : : GPS_OK_FIX_3D ) {
check_failed ( ARMING_CHECK_GPS , report , " Bad GPS Position " ) ;
check_failed ( ARMING_CHECK_GPS , report , " GPS位置值不佳 " ) ; //Bad GPS Position
return false ;
}
//GPS update rate acceptable
if ( ! gps . is_healthy ( ) ) {
check_failed ( ARMING_CHECK_GPS , report , " GPS is not healthy " ) ;
check_failed ( ARMING_CHECK_GPS , report , " GPS不健康 " ) ; //GPS is not healthy
return false ;
}
// check GPSs are within 50m of each other and that blending is healthy
float distance_m ;
if ( ! gps . all_consistent ( distance_m ) ) {
check_failed ( ARMING_CHECK_GPS , report , " GPS positions differ by %4.1fm " ,
check_failed ( ARMING_CHECK_GPS , report , " GPS位置相差 %4.1f米 " , //GPS positions differ by %4.1fm
( double ) distance_m ) ;
return false ;
}
if ( ! gps . blend_health_check ( ) ) {
check_failed ( ARMING_CHECK_GPS , report , " GPS blending unhealthy " ) ;
check_failed ( ARMING_CHECK_GPS , report , " GPS混合值不健康 " ) ; //GPS blending unhealthy
return false ;
}
@ -466,7 +466,7 @@ bool AP_Arming::gps_checks(bool report)
@@ -466,7 +466,7 @@ bool AP_Arming::gps_checks(bool report)
if ( AP : : ahrs ( ) . get_position ( ahrs_loc ) ) {
const float distance = gps_loc . get_distance ( ahrs_loc ) ;
if ( distance > AP_ARMING_AHRS_GPS_ERROR_MAX ) {
check_failed ( ARMING_CHECK_GPS , report , " GPS and AHRS differ by %4.1fm " , ( double ) distance ) ;
check_failed ( ARMING_CHECK_GPS , report , " GPS与姿态解算值 相差%4.1f米 " , ( double ) distance ) ; //GPS and AHRS differ by %4.1fm
return false ;
}
}
@ -477,8 +477,8 @@ bool AP_Arming::gps_checks(bool report)
@@ -477,8 +477,8 @@ bool AP_Arming::gps_checks(bool report)
if ( gps . first_unconfigured_gps ( first_unconfigured ) ) {
check_failed ( ARMING_CHECK_GPS_CONFIG ,
report ,
" GPS %d failing configuration checks " ,
first_unconfigured + 1 ) ;
" GPS%d配置检查失败 " ,
first_unconfigured + 1 ) ; //GPS %d failing configuration checks
if ( report ) {
gps . broadcast_first_configuration_failure_reason ( ) ;
}
@ -510,7 +510,7 @@ bool AP_Arming::hardware_safety_check(bool report)
@@ -510,7 +510,7 @@ bool AP_Arming::hardware_safety_check(bool report)
// check if safety switch has been pushed
if ( hal . util - > safety_switch_state ( ) = = AP_HAL : : Util : : SAFETY_DISARMED ) {
check_failed ( ARMING_CHECK_SWITCH , report , " Hardware safety switch " ) ;
check_failed ( ARMING_CHECK_SWITCH , report , " 硬件安全开关 " ) ; //Hardware safety switch
return false ;
}
}
@ -550,7 +550,7 @@ bool AP_Arming::manual_transmitter_checks(bool report)
@@ -550,7 +550,7 @@ bool AP_Arming::manual_transmitter_checks(bool report)
( checks_to_perform & ARMING_CHECK_RC ) ) {
if ( AP_Notify : : flags . failsafe_radio ) {
check_failed ( ARMING_CHECK_RC , report , " Radio failsafe on " ) ;
check_failed ( ARMING_CHECK_RC , report , " 遥控器故障保护开启 " ) ; //Radio failsafe on
return false ;
}
@ -568,7 +568,7 @@ bool AP_Arming::mission_checks(bool report)
@@ -568,7 +568,7 @@ bool AP_Arming::mission_checks(bool report)
_required_mission_items ) {
AP_Mission * mission = AP : : mission ( ) ;
if ( mission = = nullptr ) {
check_failed ( ARMING_CHECK_MISSION , report , " No mission library present " ) ;
check_failed ( ARMING_CHECK_MISSION , report , " 无任务库 " ) ; //No mission library present
# if CONFIG_HAL_BOARD == HAL_BOARD_SITL
AP_HAL : : panic ( " Mission checks requested, but no mission was allocated " ) ;
# endif // CONFIG_HAL_BOARD == HAL_BOARD_SITL
@ -576,7 +576,7 @@ bool AP_Arming::mission_checks(bool report)
@@ -576,7 +576,7 @@ bool AP_Arming::mission_checks(bool report)
}
AP_Rally * rally = AP : : rally ( ) ;
if ( rally = = nullptr ) {
check_failed ( ARMING_CHECK_MISSION , report , " No rally library present " ) ;
check_failed ( ARMING_CHECK_MISSION , report , " 无集结点库 " ) ; //No rally library present
# if CONFIG_HAL_BOARD == HAL_BOARD_SITL
AP_HAL : : panic ( " Mission checks requested, but no rally was allocated " ) ;
# endif // CONFIG_HAL_BOARD == HAL_BOARD_SITL
@ -597,7 +597,7 @@ bool AP_Arming::mission_checks(bool report)
@@ -597,7 +597,7 @@ bool AP_Arming::mission_checks(bool report)
for ( uint8_t i = 0 ; i < ARRAY_SIZE ( misChecks ) ; i + + ) {
if ( _required_mission_items & misChecks [ i ] . check ) {
if ( ! mission - > contains_item ( misChecks [ i ] . mis_item_type ) ) {
check_failed ( ARMING_CHECK_MISSION , report , " Missing mission item : %s" , misChecks [ i ] . type ) ;
check_failed ( ARMING_CHECK_MISSION , report , " 缺少任务项 : %s" , misChecks [ i ] . type ) ; //"Missing mission item: %s"
return false ;
}
}
@ -605,12 +605,12 @@ bool AP_Arming::mission_checks(bool report)
@@ -605,12 +605,12 @@ bool AP_Arming::mission_checks(bool report)
if ( _required_mission_items & MIS_ITEM_CHECK_RALLY ) {
Location ahrs_loc ;
if ( ! AP : : ahrs ( ) . get_position ( ahrs_loc ) ) {
check_failed ( ARMING_CHECK_MISSION , report , " Can't check rally without position " ) ;
check_failed ( ARMING_CHECK_MISSION , report , " 无姿态解算位置,无法检查集结点 " ) ; //Can't check rally without position
return false ;
}
RallyLocation rally_loc = { } ;
if ( ! rally - > find_nearest_rally_point ( ahrs_loc , rally_loc ) ) {
check_failed ( ARMING_CHECK_MISSION , report , " No sufficently close rally point located " ) ;
check_failed ( ARMING_CHECK_MISSION , report , " 没有足够接近的集结点 " ) ; //No sufficently close rally point located
return false ;
}
}
@ -648,7 +648,7 @@ bool AP_Arming::servo_checks(bool report) const
@@ -648,7 +648,7 @@ bool AP_Arming::servo_checks(bool report) const
const uint16_t trim = c - > get_trim ( ) ;
if ( c - > get_output_min ( ) > trim ) {
check_failed ( report , " SERVO%d minimum is greater than trim " , i + 1 ) ;
check_failed ( report , " SERVO%d minimum is greater than trim " , i + 1 ) ;
check_passed = false ;
}
if ( c - > get_output_max ( ) < trim ) {
@ -659,7 +659,7 @@ bool AP_Arming::servo_checks(bool report) const
@@ -659,7 +659,7 @@ bool AP_Arming::servo_checks(bool report) const
# if HAL_WITH_IO_MCU
if ( ! iomcu . healthy ( ) ) {
check_failed ( report , " IOMCU is unhealthy " ) ;
check_failed ( report , " IO控制器不健康 " ) ; //IOMCU is unhealthy
check_passed = false ;
}
# endif
@ -675,7 +675,7 @@ bool AP_Arming::board_voltage_checks(bool report)
@@ -675,7 +675,7 @@ bool AP_Arming::board_voltage_checks(bool report)
const float bus_voltage = hal . analogin - > board_voltage ( ) ;
const float vbus_min = AP_BoardConfig : : get_minimum_board_voltage ( ) ;
if ( ( ( bus_voltage < vbus_min ) | | ( bus_voltage > AP_ARMING_BOARD_VOLTAGE_MAX ) ) ) {
check_failed ( ARMING_CHECK_VOLTAGE , report , " Board (%1.1fv) out of range %1.1f-%1.1fv" , ( double ) bus_voltage , ( double ) vbus_min , ( double ) AP_ARMING_BOARD_VOLTAGE_MAX ) ;
check_failed ( ARMING_CHECK_VOLTAGE , report , " 板载电压 (%1.1fv) 超出范围 %1.1f-%1.1fv" , ( double ) bus_voltage , ( double ) vbus_min , ( double ) AP_ARMING_BOARD_VOLTAGE_MAX ) ; //Board (%1.1fv) out of range %1.1f-%1.1fv
return false ;
}
# endif // HAL_HAVE_BOARD_VOLTAGE
@ -685,7 +685,7 @@ bool AP_Arming::board_voltage_checks(bool report)
@@ -685,7 +685,7 @@ bool AP_Arming::board_voltage_checks(bool report)
if ( is_positive ( vservo_min ) ) {
const float servo_voltage = hal . analogin - > servorail_voltage ( ) ;
if ( servo_voltage < vservo_min ) {
check_failed ( ARMING_CHECK_VOLTAGE , report , " Servo voltage to low (%1.2fv < %1.2fv)" , ( double ) servo_voltage , ( double ) vservo_min ) ;
check_failed ( ARMING_CHECK_VOLTAGE , report , " 伺服电压过低 (%1.2fv < %1.2fv)" , ( double ) servo_voltage , ( double ) vservo_min ) ; //Servo voltage to low
return false ;
}
}
@ -702,26 +702,26 @@ bool AP_Arming::system_checks(bool report)
@@ -702,26 +702,26 @@ bool AP_Arming::system_checks(bool report)
{
if ( check_enabled ( ARMING_CHECK_SYSTEM ) ) {
if ( ! hal . storage - > healthy ( ) ) {
check_failed ( ARMING_CHECK_SYSTEM , report , " Param storage failed " ) ;
check_failed ( ARMING_CHECK_SYSTEM , report , " 参数保存错误 " ) ; //Param storage failed
return false ;
}
# if AP_TERRAIN_AVAILABLE
const AP_Terrain * terrain = AP_Terrain : : get_singleton ( ) ;
if ( ( terrain ! = nullptr ) & & terrain - > init_failed ( ) ) {
check_failed ( ARMING_CHECK_SYSTEM , report , " Terrain out of memory " ) ;
check_failed ( ARMING_CHECK_SYSTEM , report , " 地形内存不足 " ) ; //Terrain out of memory
return false ;
}
# endif
# ifdef ENABLE_SCRIPTING
const AP_Scripting * scripting = AP_Scripting : : get_singleton ( ) ;
if ( ( scripting ! = nullptr ) & & scripting - > enabled ( ) & & scripting - > init_failed ( ) ) {
check_failed ( ARMING_CHECK_SYSTEM , report , " Scripting out of memory " ) ;
check_failed ( ARMING_CHECK_SYSTEM , report , " 脚本超出内存 " ) ; //Scripting out of memory
return false ;
}
# endif
}
if ( AP : : internalerror ( ) . errors ( ) ! = 0 ) {
check_failed ( report , " Internal errors (0x%x)" , ( unsigned int ) AP : : internalerror ( ) . errors ( ) ) ;
check_failed ( report , " 内部错误 (0x%x)" , ( unsigned int ) AP : : internalerror ( ) . errors ( ) ) ; //Internal errors
return false ;
}
@ -743,7 +743,7 @@ bool AP_Arming::proximity_checks(bool report) const
@@ -743,7 +743,7 @@ bool AP_Arming::proximity_checks(bool report) const
// return false if proximity sensor unhealthy
if ( proximity - > get_status ( ) < AP_Proximity : : Status : : Good ) {
check_failed ( report , " check proximity sensor " ) ;
check_failed ( report , " 检查接近传感器 " ) ; //check proximity sensor
return false ;
}
@ -763,7 +763,7 @@ bool AP_Arming::can_checks(bool report)
@@ -763,7 +763,7 @@ bool AP_Arming::can_checks(bool report)
// To be replaced with macro saying if KDECAN library is included
# if APM_BUILD_TYPE(APM_BUILD_ArduCopter) || APM_BUILD_TYPE(APM_BUILD_ArduPlane) || APM_BUILD_TYPE(APM_BUILD_ArduSub)
AP_KDECAN * ap_kdecan = AP_KDECAN : : get_kdecan ( i ) ;
snprintf ( fail_msg , ARRAY_SIZE ( fail_msg ) , " KDECAN failed " ) ;
snprintf ( fail_msg , ARRAY_SIZE ( fail_msg ) , " KDECAN失效 " ) ; //KDECAN failed
if ( ap_kdecan ! = nullptr & & ! ap_kdecan - > pre_arm_check ( fail_msg , ARRAY_SIZE ( fail_msg ) ) ) {
check_failed ( ARMING_CHECK_SYSTEM , report , " %s " , fail_msg ) ;
return false ;
@ -773,7 +773,7 @@ bool AP_Arming::can_checks(bool report)
@@ -773,7 +773,7 @@ bool AP_Arming::can_checks(bool report)
}
case AP_BoardConfig_CAN : : Protocol_Type_UAVCAN :
{
snprintf ( fail_msg , ARRAY_SIZE ( fail_msg ) , " UAVCAN failed " ) ;
snprintf ( fail_msg , ARRAY_SIZE ( fail_msg ) , " UAVCAN失效 " ) ; //UAVCAN failed
if ( ! AP : : uavcan_server ( ) . prearm_check ( fail_msg , ARRAY_SIZE ( fail_msg ) ) ) {
check_failed ( ARMING_CHECK_SYSTEM , report , " %s " , fail_msg ) ;
return false ;
@ -804,7 +804,7 @@ bool AP_Arming::fence_checks(bool display_failure)
@@ -804,7 +804,7 @@ bool AP_Arming::fence_checks(bool display_failure)
}
if ( fail_msg = = nullptr ) {
check_failed ( display_failure , " Check fence " ) ;
check_failed ( display_failure , " 检查围栏 " ) ; //Check fence
} else {
check_failed ( display_failure , " %s " , fail_msg ) ;
}
@ -863,7 +863,7 @@ bool AP_Arming::arm_checks(AP_Arming::Method method)
@@ -863,7 +863,7 @@ bool AP_Arming::arm_checks(AP_Arming::Method method)
if ( ! logger - > logging_started ( ) & &
( ( checks_to_perform & ARMING_CHECK_ALL ) | |
( checks_to_perform & ARMING_CHECK_LOGGING ) ) ) {
check_failed ( ARMING_CHECK_LOGGING , true , " Logging not started " ) ;
check_failed ( ARMING_CHECK_LOGGING , true , " 日志记录未启动 " ) ; //Logging not started
return false ;
}
}