Aircraft Heartbeat Information
1. Overview
The DragonFish heartbeat information is reported at a frequency of 2Hz. The heartbeat information contains alarm information, flight status related information, self-test status, and compass calibration information.
2. Aircraft Heartbeat Information Instructions
2.1 Monitoring Heartbeat Information
Interface definition:
val KeyDroneLfNtfy: AutelKey<DroneKeyInfoLFNtfyBean> = KeyTools.createKey(CommonKey.KeyDroneLfNtfy)
Example code:
val KeyDroneLfNtfy: AutelKey<DroneKeyInfoLFNtfyBean> = KeyTools.createKey(CommonKey.KeyDroneLfNtfy)
val CallBack = object : CommonCallbacks.KeyListener<DroneKeyInfoLFNtfyBean> {
override fun onValueChange(oldValue: DroneKeyInfoLFNtfyBean?, newValue: DroneKeyInfoLFNtfyBean) {
val heartBeanInfo = newValue.getDFHeartBeanInfo()
}
}
//Start monitoring
DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()?.listen(key, CallBack)
//Cancel monitoring
DeviceManager.getDeviceManager().getFirstDroneDevice()?.getKeyManager()?.cancelListen(key, CallBack)
2.2 Heartbeat Interface Description
/**
* DragonFish HeartBeat Information Manager
*/
object DFHeartBeatInfo {
/**
* Resets the data to initial state
*/
fun resetData()
/**
* Checks if the heartbeat data is invalid
*/
fun isInValid(): Boolean
/**
* Gets the main flight status:Manual or Auto.
*/
fun getMainFlyState(): MainFlyState {
return MainFlyState.findEnum(this.alarmStatus2 and 0x0f)
}
/**
* Gets the flight state
*/
fun getFlightState(): FlightState
/**
* Gets the flight mode.
*/
fun getFlyMode(): FlyMode
/**
* Auto self-check status
*/
fun getAutoCheckStatus(): AutoCheckStateEnum
/**
* Gets the status of all wings
*/
fun getAllWingStatus(): AllWingStatus
/**
* Gets the battery warning status
*/
fun getBatteryWarning(): BatteryWarning
/**
* Gets the compass calibration status
*/
fun getCompassStatus(): DFCalibrateCompassStatus
/**
* Checks if the attitude is abnormal
*/
fun isAttitudeValid(): Boolean
/**
* Checks if the compass status is valid based on the invalid head direction
*/
fun isCompassValid(): Boolean
/**
* Checks if the sonar is valid
*/
fun isSonarValid(): Boolean {
return ((this.alarmStatus1 shr 6 and 0x1) == 1)
}
/**
* Checks if the airspeed sensor is valid
*/
fun isAirspeedValid(): Boolean
/**
* Checks if the GPS is valid
*/
fun isGpsValid(): Boolean
/**
* Checks if the RTK is abnormal
*/
fun isRTKValid(): Boolean
/**
* Checks if the RC is connected
*/
fun isRcConnected(): Boolean
/**
* Checks if the aircraft can take off
*/
fun isCanTakeOff(): Boolean
/**
* Tells whether the aircraft reaches the max altitude.
* */
fun isReachMaxHeight(): Boolean
/**
* Tells whether the aircraft reaches the max distance.
*/
fun isReachMaxRange(): Boolean
/**
* Checks if the flight control module is too hot
*/
fun isFCHot(): Boolean
/**
* Checks if the battery is too hot
*/
fun isBatteryHot(): Boolean
/**
* Gets the airport warning error code
*/
fun getAirportWarning(): AirportWarningEnum
/**
* Checks if IMU0 is valid
*/
fun isIMU0Valid(): Boolean
/**
* Checks if IMU1 is valid
*/
fun isIMU1Valid(): Boolean
/**
* Checks if magnetometer0 is valid
*/
fun isMagnetometer0Valid(): Boolean
/**
* Checks if magnetometer1 is valid
*/
fun isMagnetometer1Valid(): Boolean
/**
* Checks if barometer0 is valid
*/
fun isBarometer0Valid(): Boolean
/**
* 气压计1是否有效
* Checks if barometer1 is valid
*/
fun isBarometer1Valid(): Boolean
/**
* Checks if the elevator state communication is normal
*/
fun isElevatorStateCommunicationNormal(): Boolean
/**
* Checks if the firmware is activated
*/
fun isFirmwareFlagActive(): Boolean
/**
* Checks if the RTK heading is valid
*/
fun isRtkHeadingValid(): Boolean
/**
* Checks if the CPU temperature is normal
*/
fun isCpuTemperatureNormal(): Boolean
/**
* Checks if the FMU board temperature is normal
*/
fun isFmuBoardTemperatureNormal(): Boolean
/**
* Checks if the antenna1 is connected
*/
fun isAntenna1Connected(): Boolean
/**
* Checks if the antenna2 is connected
*/
fun isAntenna2Connected(): Boolean
/**
* Checks if the antenna1 is normal
*/
fun isAntenna1Normal(): Boolean
/**
* Checks if the antenna2 is normal
*/
fun isAntenna2Normal(): Boolean
/**
* Checks if the FMU SD card is normal
*/
fun isFmuSdcardNormal(): Boolean
/**
* Checks if the USB debug port is normal
*/
fun isUsbDebugNormal(): Boolean
/**
* Checks if the FMU fan is normal
*/
fun isFmuFanNormal(): Boolean
/**
* Checks if the need to pop up the self-check box
*/
fun isNeedChecking(): Boolean
/**
* Flight controller firmware version mismatch
**/
fun isModelMatch(): Boolean
/**
* Checks if the left wing is normal
*/
fun isLeftWingNormal(): Boolean
/**
* 右侧机翼是否正常
* Checks if the right wing is normal
*/
fun isRightWingNormal(): Boolean
/**
* Checks if the forward sensing system (radar) is normal
*/
fun isForwardSensingSystemNormal(): Boolean
/**
* Checks if the RTK communication is normal
* */
fun isRTKCommunicationNormal(): Boolean
/**
* GPS通讯是否正常
* Checks if the GPS communication is normal
* */
fun isGpsCommunicationNormal(): Boolean
/**
* Checks if actuator communication is normal
**/
fun isActuatorCommunicationNormal(): Boolean
/**
* Checks if navigation attitude is normal
*/
fun isNavigationAttitudeNormal(): Boolean
/**
* Fixed-wing automatic flight altitude is too low
*/
fun isFixedWingLowHeight(): Boolean
/**
* Checks if elevator state is normal
*/
fun isElevatorStateNormal(): Boolean
/**
* Checks if motor ESC state is normal
*/
fun isEscStateNormal(): Boolean
/**
* Checks if mobile base station RTK information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKValid(): Boolean
/**
* Checks if mobile base station RTK Heading2 information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKHeadingTwoValid(): Boolean
/**
* Checks if mobile base station RTK Heading information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKHeadingValid(): Boolean
/**
* Checks if mobile base station RTK position information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKPositionValid(): Boolean
/**
* Checks if mobile base station RTK speed information is valid (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKSpeedValid(): Boolean
/**
* Checks if mobile base station RTK attitude information is normal (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isBaseStationRTKAttitudeNormal(): Boolean
/**
* Checks if mobile return home point information is normal (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isMoveHomePositionNormal(): Boolean
/**
* Checks if the mobile return home point precision is normal (available when using mobile base station mode, StationType = StationType.MDBS)
*/
fun isMoveHomePrecisionNormal(): Boolean
/**
* Checks if the need to synchronize electronic fence information
*/
fun isNeedUploadGenFence(): Boolean
/**
* Checks if the current is controlled by the main device or the slave device
*/
fun isMainDevice(): Boolean
/**
* Checks if the current is in the restricted country no-fly zone
*/
fun isInRestrictedCountryNoFlyZone(): Boolean
/**
* Low battery return home prompt flag
*/
fun isLowBatteryReturnHomePromptFlag(): Boolean
/**
* Serious low battery landing flag
*/
fun isLowBatteryLandFlag(): Boolean
/**
* Navigation position information
*/
fun isNavigationPositionNormal(): Boolean
/**
* Checks if the magnetic heading and RTK heading are consistent
*/
fun isNavigationAndRTKNormal(): Boolean
/**
* 磁力计通讯是否正常
* Checks if the magnetometer communication is normal
*/
fun isMagnetometerCommunicationNormal(): Boolean
/**
* Checks if the magnetometer parameter update failed
*/
fun isMagnetometerParameterFailed(): Boolean
/**
* Checks if the target is in the attack range based on flightMode
*/
fun isTargetATTKRange(): Boolean
/**
* Checks if the left wing power model matches the body
*/
fun isLeftWingPowerModelMatch(): Boolean
/**
* Checks if the right wing power model matches the body
*/
fun isRightWingPowerModelMatch(): Boolean
/**
* Vision system validity
*/
fun isVisualValid(): Boolean
}